summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2023-03-15 15:32:15 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-15 10:38:28 +0000
commit8fd62bab5711a126e50559e3133e053c0130e764 (patch)
tree175c4888bb00c50b403a035db89801bdf2a3cc48
parentf27b843a9b1f289b32277b8f04bf59dc8a130b73 (diff)
downloadchrome-ec-8fd62bab5711a126e50559e3133e053c0130e764.tar.gz
mt8186,mt8188: skip forcing shutdown if AP is off
If the AP is off, we should stop calling chipset_force_shutdown() from re-doing shutdown. BUG=b:273657181 TEST=In S0, dut-control power_key:8.2, the chipset_force_shutdown is not called BRANCH=none Change-Id: I4413f984465f10d0f4b588cd6d80ead8464778bc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338759 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com>
-rw-r--r--power/mt8186.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/power/mt8186.c b/power/mt8186.c
index 0653c70ba0..9acb27dfa2 100644
--- a/power/mt8186.c
+++ b/power/mt8186.c
@@ -159,7 +159,13 @@ void chipset_watchdog_interrupt(enum gpio_signal signal)
void chipset_force_shutdown(enum chipset_shutdown_reason reason)
{
- CPRINTS("%s: 0x%x", __func__, reason);
+ bool chipset_off = chipset_in_state(CHIPSET_STATE_ANY_OFF);
+
+ CPRINTS("%s: 0x%x%s", __func__, reason, chipset_off ? "(skipped)" : "");
+
+ if (chipset_off)
+ return;
+
report_ap_reset(reason);
is_shutdown = true;
@@ -424,6 +430,11 @@ enum power_state power_handle_state(enum power_state state)
return POWER_S3;
case POWER_S3S5:
+ /* Stop the power key shutdown deferred in case the power key
+ * is still pressed.
+ */
+ hook_call_deferred(&chipset_force_shutdown_button_data, -1);
+
power_signal_disable_interrupt(GPIO_AP_IN_SLEEP_L);
power_signal_disable_interrupt(GPIO_AP_EC_WDTRST_L);
power_signal_disable_interrupt(GPIO_AP_EC_WARM_RST_REQ);