Re: [PATCH] hwmon: (gpio-fan) take fan_data->lock in gpio_fan_shutdown()

From: Guenter Roeck

Date: Tue Sep 01 2026 - 14:28:42 EST


On Tue, Sep 01, 2026 at 10:54:04PM +0700, Cong Nguyen wrote:
> set_fan_speed() writes the control GPIOs one bit at a time. Every
> other caller locks around it; gpio_fan_shutdown() doesn't. If it races
> a locked caller, the GPIO writes can interleave and leave the fan at a
> speed neither caller asked for.
>
> Fixes: b95579cd8795 ("hwmon: (gpio-fan) Add a shutdown handler to poweroff the fans")
> Reported-by: Sashiko AI review <sashiko-bot@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/20260830152150.27F5F1F000E9@xxxxxxxxxxxxxxx
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>

Applied.

Thanks,
Guenter