diff options
author | Edward Hill <ecgh@chromium.org> | 2020-05-20 17:42:19 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-21 19:25:31 +0000 |
commit | a64e3930338fceeb258c16dfc6b713f022fbbf41 (patch) | |
tree | db4876595ebd18c766e2ef1dacdce0c4f02b4e4f | |
parent | 61efe94f1e1ca1ebbd7c49ed9bd1bcfe8948e7f0 (diff) | |
download | chrome-ec-a64e3930338fceeb258c16dfc6b713f022fbbf41.tar.gz |
fan: Leave state.rpm = 0 in pwm_fan_init()
With no previous state saved, FAN_STATE_FLAG_ENABLED was 0 but state.rpm
was CONFIG_FAN_INIT_SPEED. This caused fan_set_rpm_target() to enable
the fan which caused "Fan 0 stalled!" warnings.
Instead just leave state.rpm at 0. This matches what pwm_fan_stop() does
on shutdown.
BUG=b:154938623
BRANCH=none
TEST=reboot ap-off, no "stalled" warning
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Ic5dbc9985c1c1b7453dcca4980585ddaf7e4f4d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2210831
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | common/fan.c | 3 | ||||
-rw-r--r-- | test/fan.c | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/common/fan.c b/common/fan.c index 669ddc519d..398a149268 100644 --- a/common/fan.c +++ b/common/fan.c @@ -498,9 +498,6 @@ static void pwm_fan_init(void) memcpy(&state, prev, sizeof(state)); } else { memset(&state, 0, sizeof(state)); - for (fan = 0; fan < fan_count; fan++) - state.rpm = fan_percent_to_rpm(FAN_CH(fan), - CONFIG_FAN_INIT_SPEED); } for (fan = 0; fan < fan_count; fan++) { diff --git a/test/fan.c b/test/fan.c index e565dd9a60..f3a9a150c9 100644 --- a/test/fan.c +++ b/test/fan.c @@ -31,9 +31,8 @@ static int test_fan(void) sleep(2); - /* With nothing else to do, fans default to CONFIG_FAN_INIT_SPEED*/ - TEST_ASSERT(fan_get_rpm_actual(0) == - fan_percent_to_rpm(0, CONFIG_FAN_INIT_SPEED)); + /* Fans initialize disabled. */ + TEST_ASSERT(fan_get_rpm_actual(0) == 0); set_thermal_control_enabled(0, 1); |