diff options
author | Diana Z <dzigterman@chromium.org> | 2023-03-15 15:50:45 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-21 21:24:24 +0000 |
commit | a63d9b0134000bff51dd3eaeca6898f1f671d768 (patch) | |
tree | fe960465ec9f719452ad029ae9719f31a527685e /power | |
parent | 36b1fc5b58ac250784e6a466f8f6f4434b9b7a41 (diff) | |
download | chrome-ec-a63d9b0134000bff51dd3eaeca6898f1f671d768.tar.gz |
Host sleep: Consider a reboot after suspend to be a resume
When we try to wake the host during a failed resume, the host may reboot
rather than actually following the resume path. In this case, we will
receive events of "0" indicating we're on a fresh boot and the chipset
RESUME hooks never run. Instead, we should treat this new boot as a
resume in order to ensure the previous SUSPEND hooks get a RESUME call
to go with them.
BRANCH=None
BUG=b:273327518
TEST=on whiterun, run suspend with bad AP FW version and ensure the
backlight turns on after we wake the host
Change-Id: I9c8e7ad70dbca5245844a31772e99097256e592f
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344029
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'power')
-rw-r--r-- | power/host_sleep.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/power/host_sleep.c b/power/host_sleep.c index 7dc83ca8e9..b0b8b624e3 100644 --- a/power/host_sleep.c +++ b/power/host_sleep.c @@ -36,6 +36,13 @@ host_command_host_sleep_event(struct host_cmd_handler_args *args) struct host_sleep_event_context ctx; enum host_sleep_event state = p->sleep_event; + /* + * Treat a reboot after suspend as a resume for notification purposes + * (see b/273327518 for more details) + */ + if (host_sleep_state == HOST_SLEEP_EVENT_S0IX_SUSPEND && state == 0) + state = HOST_SLEEP_EVENT_S0IX_RESUME; + host_sleep_state = state; ctx.sleep_transitions = 0; switch (state) { |