summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2019-02-15 18:18:39 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-20 08:20:08 -0800
commitf37c7fb0871c8c1f9c80a743a53e852f65bbbb5b (patch)
tree162379be18bbd321901ee0cf8e012364fb4451e4
parentcfcc4bc2c0f543270a91cfb30076659fbf69f32f (diff)
downloadchrome-ec-f37c7fb0871c8c1f9c80a743a53e852f65bbbb5b.tar.gz
power/intel_x86: Do not restore SCI/SMI masks if not backed up
Currently, if the host indicates intent to enter S0ix using host command but fails to drop into S0ix (i.e. assert SLP_S0#), then it results in EC not backing up SCI/SMI masks. However, SCI/SMI masks were being unconditionally restored when host sent command to exit S0ix. This resulted in failed S0ix to wipe out the SCI mask. This change skips restoring SCI/SMI masks if backup masks are zero. BUG=b:124540202 BRANCH=None TEST=Ensured that with S0ix failure, SCI mask was not wiped out. Change-Id: Ia79829b616ebff460e2436b03653f74aaf6c1ba0 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1476291 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--power/intel_x86.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/power/intel_x86.c b/power/intel_x86.c
index 195671c824..758f8c2ed5 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -177,8 +177,19 @@ static void lpc_s0ix_suspend_clear_masks(void)
*/
static void lpc_s0ix_resume_restore_masks(void)
{
+ /*
+ * No need to restore SCI/SMI masks if both backup_sci_mask and
+ * backup_smi_mask are zero. This indicates that there was a failure to
+ * enter S0ix(SLP_S0# assertion) and hence SCI/SMI masks were never
+ * backed up.
+ */
+ if (!backup_sci_mask && !backup_smi_mask)
+ return;
+
lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, backup_sci_mask);
lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, backup_smi_mask);
+
+ backup_sci_mask = backup_smi_mask = 0;
}
enum s0ix_notify_type {