Skip to content
Commit a2ca7520 authored by Billy Tsai's avatar Billy Tsai Committed by Guenter Roeck
Browse files

hwmon: (pwm-fan) Ensure the fan going on in .probe()

Before commit 86585c61 ("hwmon: (pwm-fan) stop using legacy
PWM functions and some cleanups") pwm_apply_state() was called
unconditionally in pwm_fan_probe(). In this commit this direct
call was replaced by a call to __set_pwm(ct, MAX_PWM) which
however is a noop if ctx->pwm_value already matches the value to
set.
After probe the fan is supposed to run at full speed, and the
internal driver state suggests it does, but this isn't asserted
and depending on bootloader and pwm low-level driver, the fan
might just be off.
So drop setting pwm_value to MAX_PWM to ensure the check in
__set_pwm doesn't make it exit early and the fan goes on as
intended.

Cc: stable@vger.kernel.org
Fixes: 86585c61

 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups")
Signed-off-by: default avatarBilly Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211130092212.17783-1-billy_tsai@aspeedtech.com
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 0e4190d7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment