diff options
author | Keith Short <keithshort@chromium.org> | 2021-03-04 17:02:05 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-05 02:06:38 +0000 |
commit | cc7967db8534567b4ed9d23eaf293a00a411986a (patch) | |
tree | f27545214f00c4b26ffab6fcfc2c4671a023e468 | |
parent | 8bf33a2fdeb53af0d84a5eafd99819af7be23329 (diff) | |
download | chrome-ec-cc7967db8534567b4ed9d23eaf293a00a411986a.tar.gz |
host_sleep: Fix a race condition on resume from S0ix
When resuming for S0ix, the CHIPSET task transitions to the POWER_S0ixS0
state and sets a timer to ensure the AP sends
HOST_SLEEP_EVENT_S0IX_RESUME. However, the APs resume message can
sometimes arrive before the CHIPSET task transitions to POWER_S0ixS0.
This sequence causes the EC to generate a false
EC_HOST_EVENT_HANG_DETECT event during resume.
BUG=b:180592353
BRANCH=volteer
TEST=Repeatedly run "powerd_dbus_suspend" from AP and resume using
built-in keyboard.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I550daaaf5411c31f17d608cc341f86da9b934a84
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2737552
Tested-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | power/host_sleep.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/power/host_sleep.c b/power/host_sleep.c index 8bd66d035f..909999c7a9 100644 --- a/power/host_sleep.c +++ b/power/host_sleep.c @@ -178,6 +178,12 @@ void sleep_start_suspend(struct host_sleep_event_context *ctx, void sleep_complete_resume(struct host_sleep_event_context *ctx) { + /* + * Ensure we don't schedule another sleep_transition_timeout + * if the the HOST_SLEEP_EVENT_S0IX_RESUME message arrives before + * the CHIPSET task transitions to the POWER_S0ixS0 state. + */ + sleep_signal_timeout = 0; hook_call_deferred(&sleep_transition_timeout_data, -1); ctx->sleep_transitions = sleep_signal_transitions; } |