From a42edb86c59cbc145eb99bd5b65bbd1f5567320e Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 16 Jul 2012 14:40:50 -0700 Subject: [PATCH] Print console messages for overtemp and shutdown I have a system with bad temperature sensors and the EC is constantly shutting the system down, but provides no visible indication that it is doing so. I have serious concerns about the EC behavior in this case as it seems to be doing things it shouldn't. However just providing indication via the console about what it is doing is at least useful for development and debug. BUG=none TEST=boot on system with bad temp sensors and see that the EC indicates it is initiating a shutdown. [14.008340 critical temperature; shutting down] [14.008660 x86 power force shutdown] [14.009153 LPC RESET# asserted] Change-Id: I6beeb269a135bd8c245c0357670fe29648d48968 Signed-off-by: Duncan Laurie Reviewed-on: https://gerrit.chromium.org/gerrit/27553 Reviewed-by: Randall Spangler --- common/thermal.c | 2 ++ common/x86_power.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/thermal.c b/common/thermal.c index fa54b3123b..7d2640a1ad 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -105,6 +105,8 @@ static void smi_sensor_failure_warning(void) static void overheated_action(void) { if (overheated[THRESHOLD_POWER_DOWN]) { + cprintf(CC_CHIPSET, + "[%T critical temperature; shutting down]\n"); x86_power_force_shutdown(); return; } diff --git a/common/x86_power.c b/common/x86_power.c index 7136795529..cd599692d2 100644 --- a/common/x86_power.c +++ b/common/x86_power.c @@ -181,8 +181,10 @@ void x86_power_cpu_overheated(int too_hot) if (too_hot) { overheat_count++; - if (overheat_count > 3) + if (overheat_count > 3) { + CPRINTF("[%T overheated; shutting down]\n"); x86_power_force_shutdown(); + } } else { overheat_count = 0; } @@ -190,6 +192,8 @@ void x86_power_cpu_overheated(int too_hot) void x86_power_force_shutdown(void) { + CPRINTF("[%T x86 power force shutdown]\n"); + /* * Force x86 off. This condition will reset once the state machine * transitions to G3.