From 905412da08b88373f16be832b0d932d30402b13c Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Thu, 30 Jun 2022 13:04:45 +0800 Subject: power/mt8186: fix the init value of is_exiting_off is_exiting_off means that EC wants to leave S5/G3. If EC is already in S0 during initialization, this flag should be false. BUG=b:237499922 TEST=1) `reboot ro` 2) wait until device reaches S0 3) `sysjump rw` 4) `apshutdown` make sure AP stays at G3 BRANCH=none Signed-off-by: Ting Shen Change-Id: Ibac81cd5d1b62d153fc9aa77d33e04754bb0db9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3735621 Tested-by: Ting Shen Reviewed-by: Eric Yilun Lin Commit-Queue: Ting Shen --- power/mt8186.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'power') diff --git a/power/mt8186.c b/power/mt8186.c index fcbe94dcee..a9f871d3d6 100644 --- a/power/mt8186.c +++ b/power/mt8186.c @@ -298,9 +298,14 @@ enum power_state power_chipset_init(void) */ battery_wait_for_stable(); - if (exit_hard_off) - /* Auto-power on */ - mt8186_exit_off(); + if (exit_hard_off) { + if (init_state == POWER_S5 || init_state == POWER_G3) { + /* Auto-power on */ + mt8186_exit_off(); + } else { + is_exiting_off = false; + } + } if (init_state != POWER_G3 && !exit_hard_off) /* Force shutdown from S5 if the PMIC is already up. */ -- cgit v1.2.1