summaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorBaek Kyu, Kim <pocj8ur4in@gmail.com>2026-10-31 18:50:39 +0900
committerGuenter Roeck <linux@roeck-us.net>2026-11-02 07:00:05 -0800
commitf324179e6ccd05dfdc8e98fba2e9d50aea8e7ea2 (patch)
treee407d2bf6584fa5f889039b8ee4bcc334745c5c4 /scripts/const_structs.checkpatch
parent7cd60538073e465310c94b2a2f0ea8d2f03768ef (diff)
hwmon: (gpio-fan) Update the speed cache before dropping the PM reference
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") Cc: stable@vger.kernel.org Signed-off-by: Baek Kyu, Kim <pocj8ur4in@gmail.com> Link: https://patch.msgid.link/20261031095039.11683-1-pocj8ur4in@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions