diff options
author | Archana Patni <archana.patni@intel.com> | 2022-11-10 10:27:57 +0530 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-10 19:17:17 +0000 |
commit | bbee2bafbfbb5df95a25ff56d76b3cacce084b66 (patch) | |
tree | 7b5b21d5f01f052f014f3d128a4ccd342d8e841d /zephyr/subsys | |
parent | 9099c1b88f5c50e4383d49a311a89ade5ff28c98 (diff) | |
download | chrome-ec-bbee2bafbfbb5df95a25ff56d76b3cacce084b66.tar.gz |
ap_pwrseq: reset sleep state after a full resume
This sleep state should be reset only after a full resume.
Clearing it after suspend can create a state mismatch between ec and
AP when slp_s0 toggles and then goes back to sleep in certain cases.
The S0->S0S0ix transition in the power state machine looks up
the sleep state variable. If there is a transition from s0ix to S0 in EC
due to a SLP S0 signal toggle without a full system wake,
the transition back to s0ix will not happen since the sleep state variable
for host will not reflect a suspended state due to the reset. This patch
fixes this issue by resetting the state only after a full resume.
BUG=b:246231274
BRANCH=none
TEST=zmake build nivviks
Tested using 'powerd_dbus_suspend' on AP and observed no issues in
dozing stress test.
Change-Id: I147986966e9420a740cb1064d6122e28f71cd8b6
Signed-off-by: Subramony Sesha <subramony.sesha@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019704
Tested-by: Andrew McRae <amcrae@google.com>
Reviewed-by: Andrew McRae <amcrae@google.com>
Code-Coverage: Andrew McRae <amcrae@google.com>
Tested-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>
Commit-Queue: Andrew McRae <amcrae@google.com>
Diffstat (limited to 'zephyr/subsys')
-rw-r--r-- | zephyr/subsys/ap_pwrseq/power_host_sleep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/zephyr/subsys/ap_pwrseq/power_host_sleep.c b/zephyr/subsys/ap_pwrseq/power_host_sleep.c index 30025d21ea..bc38215921 100644 --- a/zephyr/subsys/ap_pwrseq/power_host_sleep.c +++ b/zephyr/subsys/ap_pwrseq/power_host_sleep.c @@ -174,10 +174,11 @@ void ap_power_sleep_notify_transition(enum ap_power_sleep_type check_state) ap_power_ev_send_callbacks(AP_POWER_SUSPEND); } else if (check_state == AP_POWER_SLEEP_RESUME) { ap_power_ev_send_callbacks(AP_POWER_RESUME); + /* + * Transition is done; reset sleep state after resume. + */ + ap_power_sleep_set_notify(AP_POWER_SLEEP_NONE); } - - /* Transition is done; reset sleep state. */ - ap_power_sleep_set_notify(AP_POWER_SLEEP_NONE); } #endif /* CONFIG_AP_PWRSEQ_S0IX */ |