Thread (2 messages) 2 messages, 2 authors, 16d ago
COLD16d

[PATCH] pmdomain: renesas: rmobile-sysc: propagate power-off timeout

From: Pengpeng Hou <hidden>
Date: 2026-06-23 13:54:41
Also in: linux-renesas-soc, lkml
Subsystem: arm/risc-v/renesas architecture, generic pm domains, the rest · Maintainers: Geert Uytterhoeven, Magnus Damm, Ulf Hansson, Linus Torvalds

rmobile_pd_power_down() writes SPDCR and polls for the power-down
request bit to clear, but drops the poll result. It can therefore return
success to genpd even if the controller did not acknowledge the
power-off request.

Return the poll timeout just like the matching power-on path already
does for SWUCR.

Fixes: a00d47f7645d ("soc: renesas: rmobile-sysc: Convert to readl_poll_timeout_atomic()")
Signed-off-by: Pengpeng Hou <redacted>
---
 drivers/pmdomain/renesas/rmobile-sysc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/renesas/rmobile-sysc.c b/drivers/pmdomain/renesas/rmobile-sysc.c
index 93103ff33..9abf60ea0 100644
--- a/drivers/pmdomain/renesas/rmobile-sysc.c
+++ b/drivers/pmdomain/renesas/rmobile-sysc.c
@@ -48,6 +48,7 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
 	struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd);
 	unsigned int mask = BIT(rmobile_pd->bit_shift);
 	u32 val;
+	int ret;
 
 	if (rmobile_pd->suspend) {
 		int ret = rmobile_pd->suspend();
@@ -59,8 +60,11 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
 	if (readl(rmobile_pd->base + PSTR) & mask) {
 		writel(mask, rmobile_pd->base + SPDCR);
 
-		readl_poll_timeout_atomic(rmobile_pd->base + SPDCR, val,
-					  !(val & mask), 0, PSTR_RETRIES);
+		ret = readl_poll_timeout_atomic(rmobile_pd->base + SPDCR, val,
+						!(val & mask), 0,
+						PSTR_RETRIES);
+		if (ret)
+			return ret;
 	}
 
 	pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask,
-- 
2.50.1 (Apple Git-155)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help