diff options
author | Sam McNally <sammc@chromium.org> | 2022-12-05 13:17:54 +1100 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-12-05 03:49:31 +0000 |
commit | 7d1d331031e9db8bd9c8600fe9f96472d338c508 (patch) | |
tree | d553b071dcfb37926386cc4b63a44386b70f1618 | |
parent | a64d661d2e217ad673a0985c4aa0dde245a94c3d (diff) | |
download | chrome-ec-7d1d331031e9db8bd9c8600fe9f96472d338c508.tar.gz |
ap_pwrseq: Do not backup already-cleared SCI and SMI hostevent masks
In some situations, the S0S0ix power state is entered multiple times
ahead of a resume to the point that the kernel sends a host event
indicating the resume, where the SCI and SMI hostevent masks are
restored. When the masks are cleared more than once, the previous
backups are overwritten by the already-cleared values, and the original
masks are lost.
BUG=b:261318939
TEST=hostevent SCI mask is restored after S0ix with a touchpad click
while the lid is closed
BRANCH=nissa
Change-Id: I8e93ed79a745f7f4c525fb7a8a419198d086448f
Signed-off-by: Sam McNally <sammc@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4075654
Reviewed-by: Andrew McRae <amcrae@google.com>
Code-Coverage: Andrew McRae <amcrae@google.com>
Commit-Queue: Andrew McRae <amcrae@google.com>
-rw-r--r-- | zephyr/subsys/ap_pwrseq/power_host_sleep.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/zephyr/subsys/ap_pwrseq/power_host_sleep.c b/zephyr/subsys/ap_pwrseq/power_host_sleep.c index bc38215921..5c91b2503e 100644 --- a/zephyr/subsys/ap_pwrseq/power_host_sleep.c +++ b/zephyr/subsys/ap_pwrseq/power_host_sleep.c @@ -113,8 +113,17 @@ enum ap_power_sleep_type sleep_state = AP_POWER_SLEEP_NONE; */ static void power_s0ix_suspend_clear_masks(void) { - backup_sci_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SCI); - backup_smi_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SMI); + host_event_t sci_mask, smi_mask; + + sci_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SCI); + smi_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SMI); + + /* Do not backup already-cleared SCI/SMI masks. */ + if (!sci_mask && !smi_mask) + return; + + backup_sci_mask = sci_mask; + backup_smi_mask = smi_mask; lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, 0); lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, 0); } |