Charge state machine polls every second even when discharging in S5 |
||||
Issue description
The end of the charger task does this:
/* How long to sleep? */
if (problems_exist)
/* If there are errors, don't wait very long. */
sleep_usec = CHARGE_POLL_PERIOD_SHORT;
else if (sleep_usec <= 0) {
/* default values depend on the state */
if (curr.state == ST_IDLE ||
curr.state == ST_DISCHARGE) {
/* If AP is off, we can sleep a long time */
if (chipset_in_state(CHIPSET_STATE_ANY_OFF |
CHIPSET_STATE_SUSPEND))
sleep_usec =
CHARGE_POLL_PERIOD_VERY_LONG;
else
/* Discharging, not too urgent */
sleep_usec = CHARGE_POLL_PERIOD_LONG;
} else {
/* Charging, so pay closer attention */
sleep_usec = CHARGE_POLL_PERIOD_CHARGE;
}
}
/* Adjust for time spent in this loop */
sleep_usec -= (int)(get_time().val - curr.ts.val);
if (sleep_usec < CHARGE_MIN_SLEEP_USEC)
sleep_usec = CHARGE_MIN_SLEEP_USEC;
else if (sleep_usec > CHARGE_MAX_SLEEP_USEC)
sleep_usec = CHARGE_MAX_SLEEP_USEC;
CHARGE_POLL_PERIOD_VERY_LONG is 60 seconds
But CHARGE_MAX_SLEEP_USEC is 1 second, so we'll never actually sleep more than that.
This causes more battery I2C activity in S5/G3 than there should be, which increases power consumption in S5/G3.
Is there a reason why we capped it at a second, or can we change CHARGE_MAX_SLEEP_USEC to 60*SECOND?
,
Jul 14 2016
I *think* we were just being careful. I strongly doubt that it would go from "Everything's fine" to "I'm way too hot, gonna explode" in 60 seconds, but I can't find any Samus-specific battery docs, and the lawyerbot has eaten any relevant emails. If you can track down the battery datasheets, that would be helpful.
,
Jul 17 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 14
,
Dec 18
dupe of b/69695376 which got fixed a while back. |
||||
►
Sign in to add a comment |
||||
Comment 1 by rspangler@chromium.org
, Jun 28 2016