Re: [hwmon PATCH v2 1/8] hwmon: (adt7470) Fix fans stuck in manual mode on I2C errors

From: Guenter Roeck

Date: Mon Jul 27 2026 - 20:55:43 EST


On Mon, Jul 27, 2026 at 09:22:17PM -0300, Luiz Angelo Daros de Luca wrote:
> During adt7470_read_temperatures(), the driver temporarily switches
> the PWM channels to manual mode, performs the temperature collection,
> and then restores the original configuration registers.
>
> However, if an I2C transaction fails at any point after entering manual
> mode, the function aborts and returns immediately. This leaves the
> configuration registers un-restored, permanently trapping the fans in
> manual mode.
>
> Introduce a recovery path to ensure that the original PWM configuration
> registers are always restored, even when intermediate I2C operations
> fail.
>
> Reported-by: sashiko-bot@xxxxxxxxxx
> Closes: https://lore.kernel.org/r/20260716213252.EACA71F000E9@xxxxxxxxxxxxxxx
> Fixes: ef67959c4253 ("hwmon: (adt7470) Convert to use regmap")
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>

Applied.

Thanks,
Guenter