diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-11-12 17:02:48 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-14 02:51:41 +0000 |
commit | 27c170587fdcc368f461f87fbc7d62d3d738fa12 (patch) | |
tree | 44dc7de6d4edf394424d720aadf8bf8fb90bbc09 /power/sc7180.c | |
parent | a7bc367e9af458ab8c5fa8f091ee451be55ea770 (diff) | |
download | chrome-ec-27c170587fdcc368f461f87fbc7d62d3d738fa12.tar.gz |
sc7180: Fix forever loop if not enough power to boot AP
When the power supply is not enough (<10W adapter and no battery)
to boot AP, should clear the boot_from_off flag and go back to S5;
otherwise, the boot_from_off flag will trigger the power-on again.
Also do the same on power_on() sequence failed.
Increase the delay of checking power, such that the messages are
not too noisy.
BRANCH=None
BUG=b:167155164
TEST=Unplugged the battery, plugged a <10W adapter, checked the
"Not enough power to boot (-1 %, 7500 mW)" message just showed 10x.
Change-Id: Id7c5e66dab62bc71d3e2e00b3be172e13a146ed5
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2536554
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'power/sc7180.c')
-rw-r--r-- | power/sc7180.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/power/sc7180.c b/power/sc7180.c index 08612d1f55..58e859c307 100644 --- a/power/sc7180.c +++ b/power/sc7180.c @@ -77,7 +77,7 @@ #define CAN_BOOT_AP_CHECK_TIMEOUT (1500 * MSEC) /* Wait for polling if the system can boot AP */ -#define CAN_BOOT_AP_CHECK_WAIT (100 * MSEC) +#define CAN_BOOT_AP_CHECK_WAIT (200 * MSEC) /* The timeout of the check if the switchcap outputs good voltage */ #define SWITCHCAP_PG_CHECK_TIMEOUT (50 * MSEC) @@ -945,14 +945,17 @@ enum power_state power_handle_state(enum power_state state) power_button_wait_for_release(-1); /* If no enough power, return back to S5. */ - if (!power_is_enough()) + if (!power_is_enough()) { + boot_from_off = 0; return POWER_S5; + } /* Initialize components to ready state before AP is up. */ hook_notify(HOOK_CHIPSET_PRE_INIT); if (power_on() != EC_SUCCESS) { power_off(); + boot_from_off = 0; return POWER_S5; } CPRINTS("AP running ..."); |