summaryrefslogtreecommitdiffstats
path: root/drivers/pmdomain
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2023-10-24 07:10:40 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-28 17:19:59 +0000
commitfc6e70a26516cdef5bdd0abcef9582d6c95b42a5 (patch)
treecacf336ca31bb4788350cad18d4d7c842d8fd5df /drivers/pmdomain
parentbf5dd542721a4f5145b241cf51e92f3809855d27 (diff)
downloadlinux-stable-fc6e70a26516cdef5bdd0abcef9582d6c95b42a5.tar.gz
linux-stable-fc6e70a26516cdef5bdd0abcef9582d6c95b42a5.tar.bz2
linux-stable-fc6e70a26516cdef5bdd0abcef9582d6c95b42a5.zip
pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable
commit 2e75396f1df61e1f1d26d0d703fc7292c4ae4371 upstream. The commit c494a447c14e ("soc: bcm: bcm2835-power: Refactor ASB control") refactored the ASB control by using a general function to handle both the enable and disable. But this patch introduced a subtle regression: we need to check if !!(readl(base + reg) & ASB_ACK) == enable, not just check if (readl(base + reg) & ASB_ACK) == true. Currently, this is causing an invalid register state in V3D when unloading and loading the driver, because `bcm2835_asb_disable()` will return -ETIMEDOUT and `bcm2835_asb_power_off()` will fail to disable the ASB slave for V3D. Fixes: c494a447c14e ("soc: bcm: bcm2835-power: Refactor ASB control") Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231024101251.6357-2-mcanal@igalia.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r--drivers/pmdomain/bcm/bcm2835-power.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pmdomain/bcm/bcm2835-power.c b/drivers/pmdomain/bcm/bcm2835-power.c
index 1a179d4e011c..d2f0233cb620 100644
--- a/drivers/pmdomain/bcm/bcm2835-power.c
+++ b/drivers/pmdomain/bcm/bcm2835-power.c
@@ -175,7 +175,7 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable
}
writel(PM_PASSWORD | val, base + reg);
- while (readl(base + reg) & ASB_ACK) {
+ while (!!(readl(base + reg) & ASB_ACK) == enable) {
cpu_relax();
if (ktime_get_ns() - start >= 1000)
return -ETIMEDOUT;