summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-04-04 10:49:09 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-04-04 22:18:25 +0000
commitdfb7ac632baa0b32a2b4422aeb89a7dd14536278 (patch)
tree0c66ef2d559bae10ddd3953f9d3d2e842e6fa708
parent34651bcb933c58d43d83d26e1d90f4f05f64da1f (diff)
downloadchrome-ec-dfb7ac632baa0b32a2b4422aeb89a7dd14536278.tar.gz
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 <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193223 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--board/samus/power_sequence.c14
1 files changed, 14 insertions, 0 deletions
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);
@@ -327,6 +335,12 @@ enum power_state power_handle_state(enum power_state state)
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.
*/