From 0af6e77a3a90299418628a997c81436acbec242c Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Sat, 19 Dec 2015 10:38:52 -0800 Subject: charger: Change unlocked battery level ignore conditions x86 systems will auto-power-on when power is applied to the EC. When the battery level is critically low, power-on is prevented, except when the system is unlocked. So, when unlocked, some systems will auto-power-on regardless of battery level, overcurrent the charger / battery, and then repeat forever. Prevent this reboot loop by ignoring auto-power-up when the battery is critically low, regardless of system unlocked status. BUG=chrome-os-partner:48339 TEST=Verify power-up is prevented on no-battery chell w/ donette. Then, run 'powerbtn' on EC console and verify system powers on (and overcurrents). BRANCH=None Change-Id: Ia631b5a8c45b42ec805e4a0c3f827929a0efd236 Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/319187 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Duncan Laurie --- power/skylake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'power') diff --git a/power/skylake.c b/power/skylake.c index 8c28b6d42e..c15c26d1f7 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -198,7 +198,7 @@ static enum power_state _power_handle_state(enum power_state state) * Allow up to 1s for charger to be initialized, in case * we're trying to boot the AP with no battery. */ - while (charge_prevent_power_on() && + while (charge_prevent_power_on(0) && tries++ < CHARGER_INITIALIZED_TRIES) { msleep(CHARGER_INITIALIZED_DELAY_MS); } -- cgit v1.2.1