[RFC PATCH] thermal: rzg3e: Propagate reset assertion failure from suspend
From: Pengpeng Hou
Date: Fri Aug 28 2026 - 05:23:01 EST
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 remains an RFC because a
reset assertion failure can represent partial hardware state and the
preferred recovery policy needs platform confirmation.
The issue was identified via static analysis and manually reviewed.
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
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 c44f5b8858d0..7686a45341b3 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)
--
2.43.0