summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-04-13 23:23:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-17 06:14:55 -0700
commit7f4ee9d48c36ee609f4cb6b49a126a3eb2c7c559 (patch)
treefa457e7b2f077f0b92d694b414c3d2638cf23cdb
parent2c33693bb3d6fd82c8ad0758ffe70cd11ba7c12a (diff)
downloadchrome-ec-7f4ee9d48c36ee609f4cb6b49a126a3eb2c7c559.tar.gz
charge_state_v2: Remove assert for no AC and no battery
The assert in the charge state machine when there is no battery and no AC is causing a lot of headaches during development, and I don't believe it adds any value to panic the EC like this as it prevents the system from coming up and any debug from happening. This is especially bad with H1 locking out any useful debug by preventing flashing the EC. On Eve EVT we have some 'bad' batteries that are not correctly asserting presence pin, and when powering with adapter this this check happens before AC_PRESENT asserts because the USB PD negotiation is still happening so the EC gets stuck in a reboot loop. Similarly we had issues with the Krill board in the Whale BFT station that was triggering the same assert. In both cases there is an underlying hardware issue which is being investigated separately, but it is impossible to debug these systems because the EC will not come up. With this assert removed the EC and AP can boot and the LED blinks red to indicate there is battery a problem and the OS also reports a problem that the battery cannot be found, and we are able to do further debug without having to open the case. Additionally the error message is printed every ~second and it is very obvious from the EC console that there is a problem. Similar issues were reported at various points on Glados, Chell, Kevin, Elm, and Reef. BUG=b:35563537 BRANCH=none TEST=successfully boot and debug a failing Eve system Change-Id: I002b26d54428d29192a7097f1aae18f3223c5707 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/477733 Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r--common/charge_state_v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 5810f9c8fd..7464e446fc 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -730,7 +730,8 @@ void charger_task(void)
/* If we *know* there's no battery, wait for one to appear. */
if (curr.batt.is_present == BP_NO) {
- ASSERT(curr.ac); /* How are we running? */
+ if (!curr.ac)
+ CPRINTS("running with no battery and no AC");
curr.state = ST_IDLE;
curr.batt_is_charging = 0;
battery_was_removed = 1;