From 1db93690d9b3fed1690f6645408384451c42519b Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Thu, 1 Mar 2012 14:07:31 -0800 Subject: [PATCH] Report error when PECI temperature read fails. We used to have flaky PECI temperature read so we ignored failure. Now the PECI temperature read seems to work fine so we should have it report error on failure. Signed-off-by: Vic Yang BUG=chrome-os-partner:7493 TEST=When powered off, 'temps' shows error on PECI temperature reading. Change-Id: I161a8f84f66ba06959c21838ee364b2f8d8b4945 --- chip/lm4/peci.c | 6 ++---- common/thermal.c | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c index 732a45b24d..f3479821e2 100644 --- a/chip/lm4/peci.c +++ b/chip/lm4/peci.c @@ -53,12 +53,10 @@ int peci_get_cpu_temp(void) int peci_temp_sensor_poll(void) { - int val = peci_get_cpu_temp(); + last_temp_val = peci_get_cpu_temp(); - if (val > 0) { - last_temp_val = val; + if (last_temp_val > 0) return EC_SUCCESS; - } else return EC_ERROR_UNKNOWN; } diff --git a/common/thermal.c b/common/thermal.c index b1f492e408..63b28aae53 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -144,10 +144,8 @@ static void thermal_process(void) continue; cur_temp = temp_sensor_read(i); + /* Sensor failure. */ - /* TODO: PECI temperature sensor is currently flaky and thus - * sensor failure is now ignored. Change this when we have - * reliable PECI temperature sensor. */ if (cur_temp == -1) { if (flag & THERMAL_CONFIG_WARNING_ON_FAIL) smi_sensor_failure_warning();