mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
	John Madieu <john.madieu.xa@bp.renesas.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] thermal: rzg3e: Propagate reset assertion failure from suspend
Date: Mon, 28 Sep 2026 18:36:06 +0200	[thread overview]
Message-ID: <e2c60ddc-b28f-4e49-9d52-590f14f374b5@oss.qualcomm.com> (raw)
In-Reply-To: <20260828092123.9707-1-pengpeng@iscas.ac.cn>

On 8/28/26 11:21, Pengpeng Hou wrote:
> 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@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 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)

Sounds reasonable

John ?

  reply	other threads:[~2026-09-28 16:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  9:21 Pengpeng Hou
2026-09-28 16:36 ` Daniel Lezcano [this message]
2026-09-29 10:39   ` claudiu beznea
2026-09-29 11:57 ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2c60ddc-b28f-4e49-9d52-590f14f374b5@oss.qualcomm.com \
    --to=daniel.lezcano@oss.qualcomm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=john.madieu.xa@bp.renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pengpeng@iscas.ac.cn \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®