summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-03-04 17:02:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-03-05 02:16:18 +0000
commit7cbb9c0e2cb36d2ce6a8352b9a3e2334af543c7f (patch)
tree58b015d97270ecb635f779e839ace6206e3b1c2c
parentfd4348026cba943f76e510de038dcf7607bb8ed9 (diff)
downloadchrome-ec-7cbb9c0e2cb36d2ce6a8352b9a3e2334af543c7f.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> (cherry picked from commit cc7967db8534567b4ed9d23eaf293a00a411986a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738294
-rw-r--r--power/host_sleep.c6
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;
}