Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Baek Kyu, Kim" <pocj8ur4in@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (gpio-fan) Update the speed cache before dropping the PM reference
Date: Sat, 31 Oct 2026 09:56:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-191880@kernel.org> (raw)
In-Reply-To: <20261031095039.11683-1-pocj8ur4in@gmail.com>

> set_fan_speed() writes the GPIO control value before dropping the runtime
> PM reference when stopping the fan. pm_runtime_put_sync() decrements the
> usage count even when suspending the device fails, but the error return
> currently leaves speed_index at the previous running speed.
> 
> A request for that same running speed then returns success without
> changing the GPIOs or taking a runtime PM reference. Retrying the stop
> instead drops a reference the driver no longer owns and can trigger a
> runtime PM usage count underflow warning.
> 
> Update speed_index after writing the GPIOs and before dropping the PM
> reference. The initial same-speed check already excludes a stopped fan,
> so a zero target is sufficient to identify the transition that needs a
> PM put. Preserve the PM error return and the CONFIG_PM=n exception.
> 
> This keeps the cached control state and PM reference ownership consistent
> without restoring running GPIOs after a possibly partial supply failure.
> It does not clear persistent runtime PM errors or claim that a failing
> regulator has successfully powered off.
> 
> Fixes: 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support")
> 
> Signed-off-by: Baek Kyu, Kim <pocj8ur4in@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031095039.11683-1-pocj8ur4in@gmail.com?part=1


  reply	other threads:[~2026-10-31  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  9:50 [PATCH] hwmon: (gpio-fan) Update the speed cache before dropping the PM reference Baek Kyu, Kim
2026-10-31  9:56 ` sashiko-bot [this message]
2026-10-31 15:38 ` Guenter Roeck

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=sashiko-outbox-191880@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=pocj8ur4in@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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