summaryrefslogtreecommitdiff
path: root/test/fan.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-05-20 17:42:19 -0600
committerCommit Bot <commit-bot@chromium.org>2020-05-21 19:25:31 +0000
commita64e3930338fceeb258c16dfc6b713f022fbbf41 (patch)
treedb4876595ebd18c766e2ef1dacdce0c4f02b4e4f /test/fan.c
parent61efe94f1e1ca1ebbd7c49ed9bd1bcfe8948e7f0 (diff)
downloadchrome-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>
Diffstat (limited to 'test/fan.c')
-rw-r--r--test/fan.c5
1 files changed, 2 insertions, 3 deletions
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);