You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Charge sustainer charges to the upper threshold at every AC connection, so the lower threshold applies only while AC stays connected #102
Framework Laptop 13 (AMD Ryzen AI 300 Series), Ryzen AI 9 HX 370
BIOS 04.02, EC lilac-4.0.2-fdbf549
BIOS battery charge limit at 99%, Battery Extender disabled. At 100% the firmware clears the sustainer every second, which wipes thresholds set from the OS (see SoftwareFirmwareIssueTracker#85).
Ubuntu 26.04, Linux 7.0, cros_charge_control loaded with probe_with_fwk_charge_control=1. GNOME's Preserve Battery Health (UPower) sets charge_control_start_threshold to 40 and charge_control_end_threshold to 60, which the driver passes to the EC as the sustainer's lower and upper limits.
Issue Description
The sustainer follows the lower threshold only while AC power stays connected. Whenever AC power is connected again, the EC charges the battery up to the upper threshold, whatever the charge, so the lower threshold has no effect on a laptop which is unplugged and plugged in again during the day, for example when it is carried between desks or to a meeting.
UPower's charge history from one week shows it at every connection above the lower threshold:
Connected (CET)
Charge
Result
2026-11-07 21:46
42%
charging, up to 60%
2026-11-08 00:20
45%
charging, up to 60%
2026-11-08 12:16
48%
charging, 60% reached at 12:26
2026-11-10 21:02
59%
charging, up to 60%
2026-11-12 14:44
58%
charging, until unplugged at 59%
2026-11-12 14:48
58%
charging, until unplugged at 59%
While AC power stays connected, the sustainer holds as expected. On 2026-11-08 at 04:09 the battery stayed at 58% without charging, and on 2026-10-22 at 09:09 at 59%.
The same applies to the firmware's own charge limit, which becomes the sustainer window from 5% below the limit up to the limit (as described in #84): every connection tops the battery up to the limit.
Suggested fix
When AC power is connected with the sustainer enabled and the charge between the lower and the upper limit, start the sustainer in CHARGE_CONTROL_IDLE (or CHARGE_CONTROL_DISCHARGE with EC_CHARGE_CONTROL_FLAG_NO_IDLE) instead of CHARGE_CONTROL_NORMAL. Below the lower limit it would charge up to the upper limit, as now. This could be done in process_ac_change() when AC power appears, or as a first evaluation in sustain_battery_soc() after an AC connection.
Activity