Plucky debdiff: ** Description changed:
- I can reproduce it after a couple of tries on my Dell Rugged 5430 - equipped with 2 batteries. My assumption is that may happen on any - hardware with 2+ batteries with plucky and upower 1.90.7-1build1. + Thank you @dgadomski for the bug report and original description! + + [Impact] + On machines with more than one battery and running on Ubuntu releases prior to Questing. Upower can occasionally incorrectly calculate the battery percentage leading to it adding the two percentages together instead of averaging them out when waking from sleep or restarting the upower daemon. This generally causes the battery percentage to show up as <100%. + + This has been fixed upstream in this PR: + https://gitlab.freedesktop.org/upower/upower/-/merge_requests/246 + + The proposed debdiff backports two out of the three commits since + integration tests are disabled during the build process. + + [Test Plan] + 1- On a machine with more than one battery, wake the machine from sleep repeatedly + 2- After each wake from sleep check the battery level + 3- If the charge level is much greater than what is expected or even <100% than the issue was reproduced successfully. + + [Where problems could occur] + * The machine could fail to detect a battery as being present leading to a much lower charge percentage than expected. + + [Original description] + I can reproduce it after a couple of tries on my Dell Rugged 5430 equipped with 2 batteries. My assumption is that may happen on any hardware with 2+ batteries with plucky and upower 1.90.7-1build1. Sometimes after resuming from suspend upower reports more than 100% percentage on the DisplayDevice composite battery: upower -d /org/freedesktop/UPower/devices/DisplayDevice Device: /org/freedesktop/UPower/devices/DisplayDevice power supply: yes updated: śro, 23 lip 2025, 13:43:08 (28 seconds ago) has history: no has statistics: no battery present: yes state: discharging warning-level: none energy: 66,633 Wh energy-full: 36,2634 Wh energy-rate: 4,3434 W charge-cycles: N/A time to empty: 15,3 hours percentage: 183,747% icon-name: 'battery-full-symbolic' After I added some debugging code in src/up-daemon.c (ppa:dgadomski/test upower) I figured that energy_full_total is set only to the energy_full of the first battery, while energy_total has the sum of both batteries: journal -b 0 -u upower.service (...) lip 23 13:39:37 zack upowerd[3578]: TI:13:39:37 battery 0, energy: 36,263400, energy_full: 36,263400, energy_rate: 0,011400, time_to_empty: 11> lip 23 13:39:37 zack upowerd[3578]: TI:13:39:37 battery 1, energy: 30,688800, energy_full: 0,000000, energy_rate: 4,879200, time_to_empty: 226> lip 23 13:39:37 zack upowerd[3578]: TI:13:39:37 Calculating percentage and time to full/to empty for 2 batteries lip 23 13:39:37 zack upowerd[3578]: TI:13:39:37 energy_total: 66,952200 energy_full_total: 36,263400 This leads the total percentage to exceed 100% which should never be the case as I understood from the code. This results also in broken UI in gnome-control-center expecting the percentage to go as high as 100% (screenshot attached). The actual cause to this is why the battery 1 reports energy_full as 0. Test plan: 1. Suspend the machine 2. Resume from suspend. 3. Go to 1 if battery percentage is <=100%. ** Also affects: upower (Ubuntu Noble) Importance: Undecided Status: New ** Also affects: upower (Ubuntu Plucky) Importance: Undecided Status: New ** Also affects: upower (Ubuntu Jammy) Importance: Undecided Status: New ** Changed in: upower (Ubuntu Plucky) Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme) ** Changed in: upower (Ubuntu Noble) Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme) ** Changed in: upower (Ubuntu Jammy) Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme) ** Patch added: "plucky-upower.debdiff" https://bugs.launchpad.net/ubuntu/+source/upower/+bug/2117707/+attachment/5930102/+files/plucky-upower.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2117707 Title: More than 100% battery reported with 2+ batteries To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/upower/+bug/2117707/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
