Skip to content

Commit

Permalink
hwmon: (pwm-fan) Ensure the fan going on in .probe()
Browse files Browse the repository at this point in the history
Before commit 86585c6 ("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: 86585c6 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211130092212.17783-1-billy_tsai@aspeedtech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Billy Tsai authored and Guenter Roeck committed Nov 30, 2021
1 parent 0e4190d commit a2ca752
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/hwmon/pwm-fan.c
Original file line number Diff line number Diff line change
@@ -336,8 +336,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
return ret;
}

ctx->pwm_value = MAX_PWM;

pwm_init_state(ctx->pwm, &ctx->pwm_state);

/*

0 comments on commit a2ca752

Please sign in to comment.