]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable
authorMaíra Canal <mcanal@igalia.com>
Tue, 24 Oct 2023 10:10:40 +0000 (07:10 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:15:09 +0000 (17:15 +0000)
commit47ceb5151c49dc560bab4fd6925a4123e3de8853
tree1584f56bab484018a6ef6610c11434c1de91c8ce
parent37179fcc916bce8c3cc7b36d67ef814cce55142b
pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable

[ Upstream commit 2e75396f1df61e1f1d26d0d703fc7292c4ae4371 ]

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: Sasha Levin <sashal@kernel.org>
drivers/soc/bcm/bcm2835-power.c