mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable
commit2e75396f1d
upstream. The commitc494a447c1
("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:c494a447c1
("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>
This commit is contained in:
parent
bf5dd54272
commit
fc6e70a265
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue