* [PATCH v2] thermal: rzg3e: Propagate reset assertion failure from suspend
@ 2026-10-14 3:18 Pengpeng Hou
0 siblings, 0 replies; only message in thread
From: Pengpeng Hou @ 2026-10-14 3:18 UTC (permalink / raw)
To: Rafael J . Wysocki
Cc: Pengpeng Hou, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Philipp Zabel, linux-pm, linux-kernel, Claudiu Beznea
rzg3e_thermal_suspend() powers off an active sensor and then ignores
failure to assert its reset. System sleep can therefore continue without
the clean reset state expected by resume.
Return the reset error and, when the sensor had been active, try to
restore power before failing suspend. This is best-effort recovery:
reset assertion failure may leave partial hardware state, so restoring
power is not guaranteed to succeed. Preserve the original reset error.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: dc67521c20b7 ("thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC")
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
Changes since the RFC:
- resend without RFC and add Claudiu's Reviewed-by, as Daniel requested
- add the introducing Fixes tag and clarify the best-effort recovery
- rebase on current mainline; retain the reviewed code
Previous version:
https://lore.kernel.org/all/20260828092123.9707-1-pengpeng@iscas.ac.cn/
drivers/thermal/renesas/rzg3e_thermal.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/renesas/rzg3e_thermal.c
index c44f5b8858d02a7d4d6a5fbe8a8b189ab22568ba..7686a45341b3dcddccbfee11a7f832f9e1d76a15 100644
--- a/drivers/thermal/renesas/rzg3e_thermal.c
+++ b/drivers/thermal/renesas/rzg3e_thermal.c
@@ -499,15 +499,19 @@ static int rzg3e_thermal_runtime_resume(struct device *dev)
static int rzg3e_thermal_suspend(struct device *dev)
{
struct rzg3e_thermal_priv *priv = dev_get_drvdata(dev);
+ bool active = pm_runtime_active(dev);
+ int ret;
/* If device is active, power it off */
- if (pm_runtime_active(dev))
+ if (active)
rzg3e_thermal_power_off(priv);
/* Assert reset to ensure clean state after resume */
- reset_control_assert(priv->rstc);
+ ret = reset_control_assert(priv->rstc);
+ if (ret && active)
+ rzg3e_thermal_power_on(priv);
- return 0;
+ return ret;
}
static int rzg3e_thermal_resume(struct device *dev)
base-commit: 4056b3c9d3c92ea45955641dbafeb9b960e146ef
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-14 3:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 3:18 [PATCH v2] thermal: rzg3e: Propagate reset assertion failure from suspend Pengpeng Hou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®