diff options
author | Peter Marheine <pmarheine@chromium.org> | 2020-01-22 11:11:58 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-22 10:18:20 +0000 |
commit | f1519c5b4e1dd5375f77e9ad0ec98b15209425bb (patch) | |
tree | 34ef8d30d95bda1e380a182dcb216f795a793bd0 | |
parent | 27220c0776a906201d5c49a244b56508643c03b0 (diff) | |
download | chrome-ec-f1519c5b4e1dd5375f77e9ad0ec98b15209425bb.tar.gz |
power/cometlake-discrete: correctly update the SM on forced shutdown
Without this, apshutdown on the EC console turns off the system but it
thinks it's in S5 when it's actually in G3 so it doesn't respond to
power button presses to turn back on. Make the steady-state S5 handling
check whether the system is actually in S5 and transition down as
appropriate.
TEST=puff goes directly to G3 on apshutdown, but not when shutting down
gracefully.
BUG=b:147461413
BRANCH=None
Change-Id: Ic216b5e908b8a77d8d016f60dd8b0de832cf301e
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2014000
Reviewed-by: Andrew McRae <amcrae@chromium.org>
-rw-r--r-- | power/cometlake-discrete.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/power/cometlake-discrete.c b/power/cometlake-discrete.c index 8c6f114467..13f0d34eba 100644 --- a/power/cometlake-discrete.c +++ b/power/cometlake-discrete.c @@ -200,7 +200,7 @@ void chipset_force_shutdown(enum chipset_shutdown_reason reason) report_ap_reset(reason); shutdown_s0_rails(); - /* S3 is automatic based on SLP_S3 driving memory rails */ + /* S3->S5 is automatic based on SLP_S3 driving memory rails. */ shutdown_s5_rails(); } @@ -346,6 +346,16 @@ enum power_state power_handle_state(enum power_state state) shutdown_s0_rails(); break; + case POWER_S5: + /* + * Return to G3 if S5 rails are not on, probably because of + * a forced power-off. + */ + if ((power_get_signals() & CHIPSET_G3S5_POWERUP_SIGNAL) != + CHIPSET_G3S5_POWERUP_SIGNAL) + return POWER_S5G3; + break; + default: break; } |