Bug 325707 - power management automatically shuts the system down when second battery is low/dead even if the other battery is fine
Summary: power management automatically shuts the system down when second battery is l...
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement (show other bugs)
Version: 4.11.2
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
: 332906 334340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-06 16:30 UTC by Craig Magina
Modified: 2014-07-29 19:48 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Magina 2013-10-06 16:30:32 UTC
After upgrading to KDE 4.11.2 in Kubuntu 13.10, the system started to automatically shutdown when on battery and one of the two batteries is low or dead even though the other battery is fine.

Reproducible: Always

Steps to Reproduce:
1. Have 2 batteries
2. Drain one

Actual Results:  
System constantly shutsdown until plugged in or the dead battery is removed.

Expected Results:  
The system does not shutdown just because one of the systems batteries is dead.

This is a very frustrating, reoccurring bug with power management and it seems that the current system looks at batteries individually instead of working on a summation of all batteries attached to a system. Another way of testing this might be to use a laptop plugged into a UPS although I can't remember if the battery management system monitors those batteries or if it was just the gnome power manager version that did (wishlist item if KDE's doesn't).
Comment 1 nicksnf 2013-10-23 13:43:35 UTC
Same here opensuse 12.3, kde 4.11.2, laptop Lenovo T430s.
=(
Comment 2 Mikiya Okuno 2013-10-28 09:30:23 UTC
I'm facing the same problem. KDE 4.11.2 on Gentoo Linux, kernel version = 3.11.6. The model is Lenovo w530 with an external second battery.
Comment 3 Christoph Feck 2014-04-02 18:27:10 UTC
*** Bug 332906 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Feck 2014-05-08 20:36:52 UTC
*** Bug 334340 has been marked as a duplicate of this bug. ***
Comment 5 Emmanuel Pescosta 2014-06-17 17:44:00 UTC
Maybe patch from review-request https://git.reviewboard.kde.org/r/118801/ does also fix this bug, can someone please test it?
Comment 6 Emmanuel Pescosta 2014-06-23 16:47:57 UTC
Git commit 775a99e8bc1e9c5e277ff17a84a406227a5a32fb by Emmanuel Pescosta.
Committed on 17/06/2014 at 15:35.
Pushed by emmanuelp into branch 'KDE/4.11'.

Consider additional batteries for power management (when the critical battery timer is running)

After resuming from suspend, all batteries are added
to powerdevil. When a battery, with charge lower or
equal than the critical charge percentage is added, the
critical battery timer will be started.

In the current version the critical battery timeout can
only be interrupted by plugging in AC.

But if the system has more than one battery, the global
charge percentage can be greater than the critical charge
percentage and so the system shouldn't suspend. To achive
this behaviour, we calculate the global charge percentage
whenever a new battery was added and if the critical
battery timer is running and the global charge is high
enough, we stop the timer.

Also we use the already calculated global charge percentage
for the battery charge percentage notification instead of
the charge of each individual battery.

With this patch, the user can not only interrupt the critical
timer by plugging in the AC but also by plugging in a new or
additional battery (if the battery has enough charge).

Note: The 30 sec timeout message will still popup.

Tested with a Thinkpad T440s (two batteries)

@Philipp Paris: Thanks for testing!
Related: bug 329537
FIXED-IN: 4.11.11
REVIEW: 118801

M  +13   -1    powerdevil/daemon/powerdevilcore.cpp

http://commits.kde.org/kde-workspace/775a99e8bc1e9c5e277ff17a84a406227a5a32fb
Comment 7 Emmanuel Pescosta 2014-07-29 19:48:26 UTC
Git commit dc6753889e0428c7e7072d5cb9ea2cd8be4340fa by Emmanuel Pescosta.
Committed on 29/07/2014 at 19:48.
Pushed by emmanuelp into branch 'master'.

After resuming from suspend, all batteries are added to
powerdevil. When a battery, with charge lower or equal than the critical
charge percentage is added, the critical battery timer will be started.

In the current version the critical battery timeout can
only be interrupted by plugging in AC.

But if the system has more than one battery, the global
charge percentage can be greater than the critical charge
percentage and so the system shouldn't suspend. To achive
this behaviour, we calculate the global charge percentage
whenever a new battery was added and if the critical
battery timer is running and the global charge is high
enough, we stop the timer.

Also we use the already calculated global charge percentage
for the battery charge percentage notification instead of
the charge of each individual battery.

With this patch, the user can not only interrupt the critical
timer by plugging in the AC but also by plugging in a new or
additional battery (if the battery has enough charge).
Related: bug 337414, bug 329537

FIXED-IN: 5.1

M  +24   -11   daemon/powerdevilcore.cpp
M  +6    -0    daemon/powerdevilcore.h

http://commits.kde.org/powerdevil/dc6753889e0428c7e7072d5cb9ea2cd8be4340fa