summaryrefslogtreecommitdiff
path: root/power/intel_x86.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-10-17 15:24:11 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-19 00:52:27 -0700
commit3b4223f69524c65ca006a0a84bd8be367b91b62e (patch)
tree49eecc7710526c6819dc79f945777d8688a9de68 /power/intel_x86.c
parentd0320d8fd558ffc56f049a801c64cef3d8519cb2 (diff)
downloadchrome-ec-3b4223f69524c65ca006a0a84bd8be367b91b62e.tar.gz
power/intel_x86: Give host a chance to read hostevents on S0ix wake
Instead of clearing out all the host events on S0ix wake, provide an opportunity to the host to read the events and log it. Move the call to clear events to the point where host sends a command indicating exit from S0ix. BUG=b:67874513 BRANCH=None TEST=make -j buildall. Verified that host events are cleared by the host during logging. Change-Id: I339dc70d761bb851286d98c5c20094ccaefd238f Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/724188 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'power/intel_x86.c')
-rw-r--r--power/intel_x86.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/power/intel_x86.c b/power/intel_x86.c
index 3da8c9eba7..e26d9a1920 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -128,7 +128,6 @@ static void s0ix_lpc_enable_wake_mask(void)
* the chipset_resume hook is called.
*
* During S0ix exit, the wake mask for lid open and tablet mode is disabled.
- * All pending events are cleared
*/
static void s0ix_lpc_disable_wake_mask(void)
{
@@ -140,10 +139,6 @@ static void s0ix_lpc_disable_wake_mask(void)
~EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE);
lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, mask);
-
- /* clear host events */
- while (lpc_get_next_host_event() != 0)
- ;
}
}
@@ -468,8 +463,12 @@ void power_chipset_handle_host_sleep_event(enum host_sleep_event state)
#ifdef CONFIG_POWER_S0IX
if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
power_signal_enable_interrupt(sleep_sig[SYS_SLEEP_S0IX]);
- else
+ else if (state == HOST_SLEEP_EVENT_S0IX_RESUME) {
+ /* clear host events */
+ while (lpc_get_next_host_event() != 0)
+ ;
power_signal_disable_interrupt(sleep_sig[SYS_SLEEP_S0IX]);
+ }
#endif
}