diff options
author | Ravi Chandra Sadineni <ravisadineni@chromium.org> | 2019-10-24 12:55:22 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-11 19:11:13 +0000 |
commit | 9f151350684fee0ac14deed0ce31ddfd520b2a36 (patch) | |
tree | 1489730e0fddfe3c3354ed2a65c2304c6a9909d3 | |
parent | 62c9985607287f4994fb6657a65a0075ae54756e (diff) | |
download | chrome-ec-9f151350684fee0ac14deed0ce31ddfd520b2a36.tar.gz |
EC: Do not clear wake only events on resume from S3.
On path to S3, coreboot sets SCI and SMI mask to 0. It also sets
appropriate wake mask. It then clears all pending events so as to
prevent early wake (chromeec_smi_sleep). Thus the current resume
hook to clear non SCI/SMI events would clear all events when
resuming from S3 as SCI/SMI mask are set to zero. This change
thus fixes the same.
BUG=b:65976859
BRANCH=NONE
TEST=Tested suspend/resume with wakeup count on grunt.
Change-Id: Iea7652d1bdd122c2e66f52e2d8d0a6b7f2854c22
Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879517
Reviewed-by: Todd Broch <tbroch@chromium.org>
-rw-r--r-- | common/host_event_commands.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index c421ea512a..9fe5d339df 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -211,19 +211,23 @@ void lpc_s3_resume_clear_masks(void) /* * Clear events that are not part of SCI/SMI mask so as to prevent - * premature wakes on next suspend. This is needed because A.P only queries - * SCI events after resume. We do not clear SCI/SMI events as they help - * kernel identify the wake reason on resume. - * For events that are not set in SCI mask but are part of WAKE(S0ix/S3) - * masks, kernel drivers should have other ways (physical/virtual interrupt) - * pin to identify when they trigger wakes. + * premature wakes on next suspend(S0ix). This is not needed on + * suspending to S3 as coreboot clears all events on path to suspend. + * + * We preserve events that are part of SCI/SMI mask to help kernel + * identify the wake reason on resume. For events that are not set + * in SCI mask but are part of S0iX WAKE masks, kernel drivers should + * have other ways (physical/virtual interrupt) pin to identify when + * they trigger wakes. */ +#ifdef CONFIG_POWER_S0IX void clear_non_sci_events(void) { host_clear_events(~lpc_get_host_event_mask(LPC_HOST_EVENT_SCI) & ~lpc_get_host_event_mask(LPC_HOST_EVENT_SMI)); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, clear_non_sci_events, HOOK_PRIO_DEFAULT); +#endif #endif |