From eb2de572ba72cfdc5bbd93f40c4eed1a6d5cc9d9 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Tue, 21 Aug 2018 17:17:31 -0700 Subject: ICL: Fix the timeout value for SUS_SLP_L in G3S5 state The function power_wait_signals_timeout() expects the timeout value to be in usec, but a value in msec was being passed in. In addition, measuring on a system shows that the signal wait is ~150 msec, so increased the timeout value to 250 mSec. BUG=b:112913718 BRANCH=none TEST=Verfied that with this change I no longer see the console message: SLP_SUS_L didn't go high! Assuming G3. powerinfo shows: > powerinfo [2470.263452 power state 3 = S0, in 0x003f] Change-Id: I6564cbab638b80234a2574f3f700d1f33c516de1 Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1184330 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Furquan Shaikh Reviewed-by: Vijay P Hiremath --- power/icelake.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'power') diff --git a/power/icelake.c b/power/icelake.c index e9025b4d04..4e7b829322 100644 --- a/power/icelake.c +++ b/power/icelake.c @@ -18,7 +18,8 @@ /* Console output macros */ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) -#define IN_PCH_SLP_SUS_WAIT_TIME_MS 100 +/* The wait time is ~150 msec, allow for safety margin. */ +#define IN_PCH_SLP_SUS_WAIT_TIME_USEC (250 * MSEC) static int forcing_shutdown; /* Forced shutdown in progress? */ @@ -112,9 +113,12 @@ enum power_state power_handle_state(enum power_state state) CPRINTS("Pass thru GPIO_DSW_PWROK: %d", dswpwrok_in); dswpwrok_out = dswpwrok_in; - /* Now wait 100ms for SLP_SUS_L to go high based on tPCH32 */ + /* + * Now wait for SLP_SUS_L to go high based on tPCH32. If this + * signal doesn't go high within 250 msec then go back to G3. + */ if (power_wait_signals_timeout(IN_PCH_SLP_SUS_DEASSERTED, - IN_PCH_SLP_SUS_WAIT_TIME_MS) != EC_SUCCESS) { + IN_PCH_SLP_SUS_WAIT_TIME_USEC) != EC_SUCCESS) { CPRINTS("SLP_SUS_L didn't go high! Assuming G3."); return POWER_G3; } -- cgit v1.2.1