summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2021-11-10 16:43:12 +0800
committerCommit Bot <commit-bot@chromium.org>2021-12-02 03:23:13 +0000
commitfb3ce04852bf2966fb3e5818a7443df2b19f29fe (patch)
tree1de5a0c86bb525022891aec2ec9241e48ec9f8ff
parentf47a8a1558ac28bc4987df49fcb6df99278eb145 (diff)
downloadchrome-ec-fb3ce04852bf2966fb3e5818a7443df2b19f29fe.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> (cherry picked from commit 1e8809d732b006f029ce223d66774ae716946ff6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310023 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
-rw-r--r--board/morphius/thermal.c28
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);
}
}