Capacity suddenly drops to 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Confirmed
|
High
|
Jean-Baptiste Lallement |
Bug Description
current build number: 248
device name: krillin
channel: ubuntu-
[This report is used to gather data about the main issue reported in bug 1471913]
Test Case:
1. Charge the device to a reasonable capacity (between 30% and 50%)
2. Reboot it
3. Let it drain
Actual result
After some time (in this experiment it was 24h) the capacity suddenly drops to 0 (from 10% in this case)
The graph attached shows upower charges history over time.
From syslog the battery is the wakeup source so it suggests that the battery is really empty:
⟫ grep battery syslog.1454238636
Jan 31 10:31:24 ubuntu-phablet kernel: [ 3696.984325]active wakeup source: battery
Jan 31 10:47:41 ubuntu-phablet powerd[935]: Turning screen on, battery state changes
Jan 31 10:53:09 ubuntu-phablet kernel: [ 4215.152283]active wakeup source: battery suspend wakelock
Although on the upower graph, upower reports 28% left at exactly the same time (there is a +1h offset due to timezone)
09:38:36 29 discharging
11:31:56 28 discharging
11:32:28 27 discharging
[...]
11:46:41 1 discharging
11:47:11 0 discharging
Then starting from 10:31 UTC it goes down to zero in about 15 minutes. The powerd events correspond to the low battery notification.
The driver uses 2 counters:
- SOC: Read from battery meter
- UI_SOC: State of charge internal to the driver
The capacity attributes exposed by sysfs in /sys/class/
The driver linearly decreases (or increases) the UI_SOC each time the battery status is updated i.e either called from pmic when a charger is plugged or unplugged, or from the battery kthread.
If UI SOC drifts too much, the driver triggers an adjustment algorithm until
UI SOC is back within bounds. There is a calibration mechanism to calculate the periodicity and the step to use for the adjustment.
The driver syncs the RTC SOC with the UI SOC if:
- UI_SOC - SOC >MAX_DIFF_
- SOC > MIN_SOC_FOR_ADJUST (20)
The battery graph suddenly decreasing to 0, then oscillating between 0 and 1 until the battery is completely empty (<3.4V) is the symptom of this adjustment function.
For some reason this adjustment function is not triggered when it should, the difference between the SOC in the driver and the real SOC becomes significant (> 20%) and the adjustment only starts when the battery is already below a critical level.
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in canonical-devices-system-image: | |
assignee: | nobody → Jean-Baptiste Lallement (jibel) |
importance: | Undecided → High |
milestone: | none → backlog |
status: | New → Confirmed |
tags: | added: power-bugs |
Here is another graph when this issues is reproduced again.
It shows the problem with upower history (orange) not containing enough data to generate a graph corresponding to the actual capacity of the device (which confuses users a lot)
Then it shows over the last hour the effect of the adjustment function in the battery driver when the capacity (in purple) drops quickly from 21% to 0% then oscillates between 0 and 1 for 30 minutes until the device really dies (device was at 0% when voltage reached 3.4V then shutdown at 3.0V)
Now, there are the following possibilities:
1. The battery meter returns wrong data to the driver (calculation of the capacity is incorrect for example)
2. UI_SOC and SOC diverge and the adjustment is not triggered.
3. There is a battery calibration or a battery profile issue