summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorBoris Mittelberg <bmbm@google.com>2021-09-23 14:56:24 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-24 17:15:02 +0000
commitfc2b67a878f6c57c02569253032fc5d09f6c581e (patch)
tree92b363767f2343387b3297c6c5fdedfad273962a /power
parenta4056238da1d6bc6327b8d090845db9a44fe5f34 (diff)
downloadchrome-ec-fc2b67a878f6c57c02569253032fc5d09f6c581e.tar.gz
host sleep: fix infinite timeout
Add the corner case when default == infinite BUG=b:187532888 BRANCH=none TEST=manual: 1. `/usr/share/vboot/bin/make_dev_ssd.sh --edit --part=2` 2. Add `intel_idle.max_cstate=1` 3. reboot 4. (EC) `sleeptimeout infinite` 5. `echo freeze > /sys/power/state` 6. System doesn't wake up Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I5903ddd09262254a485eb9d09731bcd687b6d650 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180260 Reviewed-by: Rajat Jain <rajatja@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/host_sleep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/power/host_sleep.c b/power/host_sleep.c
index 2c62e1fb21..bfa5cbd90a 100644
--- a/power/host_sleep.c
+++ b/power/host_sleep.c
@@ -167,8 +167,10 @@ void sleep_start_suspend(struct host_sleep_event_context *ctx,
/* Use zero internally to indicate no timeout. */
if (timeout == EC_HOST_SLEEP_TIMEOUT_DEFAULT) {
timeout = host_sleep_timeout_default;
+ }
- } else if (timeout == EC_HOST_SLEEP_TIMEOUT_INFINITE) {
+ /* Use 0xFFFF to disable the timeout */
+ if (timeout == EC_HOST_SLEEP_TIMEOUT_INFINITE) {
sleep_signal_timeout = 0;
return;
}