From dfb7ac632baa0b32a2b4422aeb89a7dd14536278 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 4 Apr 2014 10:49:09 -0700 Subject: Fix idle task deep sleep on Samus. Samus' power sequence is not in common/power, so it was overlooked when enabling deep sleep support. Fix it. BUG=chrome-os-partner:27705 BRANCH=ToT TEST=manual Verify that the EC is not going into deep sleep while the AP is on by looking at the EC console: With the AP on: > idlestat Num idle calls that sleep: 1518647 Num idle calls that deep-sleep: 414 Time spent in deep-sleep: 0.000000s Total time on: 316.642174s Deep-sleep closest to wake deadline: 698us > sleepmask sleep mask: 00020001 > With the AP off (or in S3): > idlestat Num idle calls that sleep: 1846586 Num idle calls that deep-sleep: 831 Time spent in deep-sleep: 11.089183s Total time on: 388.695558s Deep-sleep closest to wake deadline: 698us > sleepmask sleep mask: 00020000 > Change-Id: Iba708b6d53f96ef6d49d42bcf6d21db4732399b0 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/193223 Reviewed-by: Alec Berg --- board/samus/power_sequence.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'board/samus/power_sequence.c') diff --git a/board/samus/power_sequence.c b/board/samus/power_sequence.c index a8bba2748d..bc06ed6222 100644 --- a/board/samus/power_sequence.c +++ b/board/samus/power_sequence.c @@ -124,6 +124,8 @@ enum power_state power_chipset_init(void) */ if (system_jumped_to_this_image()) { if ((power_get_signals() & IN_ALL_S0) == IN_ALL_S0) { + /* Disable idle task deep sleep when in S0. */ + disable_sleep(SLEEP_MASK_AP_RUN); CPRINTF("[%T already in S0]\n"); return POWER_S0; } else { @@ -298,6 +300,12 @@ enum power_state power_handle_state(enum power_state state) /* Call hooks now that rails are up */ hook_notify(HOOK_CHIPSET_RESUME); + /* + * Disable idle task deep sleep. This means that the low + * power idle task will not go into deep sleep while in S0. + */ + disable_sleep(SLEEP_MASK_AP_RUN); + /* Wait 99ms after all voltages good */ msleep(99); @@ -326,6 +334,12 @@ enum power_state power_handle_state(enum power_state state) /* Suspend wireless */ wireless_set_state(WIRELESS_SUSPEND); + /* + * Enable idle task deep sleep. Allow the low power idle task + * to go into deep sleep in S3 or lower. + */ + enable_sleep(SLEEP_MASK_AP_RUN); + /* * Deassert prochot since CPU is off and we're about to drop * +VCCP. -- cgit v1.2.1