From 3b4223f69524c65ca006a0a84bd8be367b91b62e Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Tue, 17 Oct 2017 15:24:11 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/724188 Reviewed-by: Aaron Durbin --- power/intel_x86.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'power/intel_x86.c') 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 } -- cgit v1.2.1