diff options
author | Zick Wei <zick.wei@quanta.corp-partner.google.com> | 2021-11-10 16:43:12 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-01 04:41:59 +0000 |
commit | 1e8809d732b006f029ce223d66774ae716946ff6 (patch) | |
tree | 8321828d503b4a94c08769d5fcf1269edda22c2b | |
parent | f1ba420de66fdb8b2a827bf60e228e64521dd12a (diff) | |
download | chrome-ec-1e8809d732b006f029ce223d66774ae716946ff6.tar.gz |
morphius: fix thermal control issue
In some condition, CPU prochot will always trigger by EC,
this patch fix this issue.
BUG=b:202746631
BRANCH=zork
TEST=verify prochot no longer trigger in specific steps.
Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Change-Id: I37409e2cf04fdb2d4c0ca01b8860971eff70e7d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3271799
Reviewed-by: Eric Peers <epeers@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | board/morphius/thermal.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c index 449fd92d5d..329157b6ec 100644 --- a/board/morphius/thermal.c +++ b/board/morphius/thermal.c @@ -495,16 +495,16 @@ void board_override_fan_control(int fan, int *tmp) void thermal_protect(void) { - if ((!lid_is_open()) && (!extpower_is_present())) { - int rv1, rv2; - int thermal_sensor1, thermal_sensor2; + int rv1, rv2; + int thermal_sensor1, thermal_sensor2; - rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR, - &thermal_sensor1); - rv2 = temp_sensor_read(TEMP_SENSOR_CPU, - &thermal_sensor2); + rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR, + &thermal_sensor1); + rv2 = temp_sensor_read(TEMP_SENSOR_CPU, + &thermal_sensor2); - if (rv2 == EC_SUCCESS) { + if (rv2 == EC_SUCCESS) { + if ((!lid_is_open()) && (!extpower_is_present())) { if (thermal_sensor2 > C_TO_K(70)) { chipset_throttle_cpu(1); throttle_on = 1; @@ -513,9 +513,17 @@ void thermal_protect(void) chipset_throttle_cpu(0); throttle_on = 0; } + } else { + if (throttle_on == 1) { + chipset_throttle_cpu(0); + throttle_on = 0; + } } - if (rv1 == EC_SUCCESS && - thermal_sensor1 > C_TO_K(51)) + } + + if (rv1 == EC_SUCCESS) { + if ((!lid_is_open()) && (!extpower_is_present()) + && thermal_sensor1 > C_TO_K(51)) chipset_force_shutdown(CHIPSET_SHUTDOWN_THERMAL); } } |