Bug 727717

Summary: Gnome 3 Battery status icon / Upowerd problem
Product: [Fedora] Fedora Reporter: Nicholai Cornilliac <nmcunix>
Component: kernelAssignee: John Feeney <jfeeney>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 15CC: aquini, borysjr, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, martin.wilck, rhughes, richard, r_wellington
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-11 17:54:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/usr/libexec/upowerd --verbose
none
acpidump
none
/var/lib/upower/history-charge-Modelxxx-57.dat
none
tentative patch for the acpi_battery_refresh() case
none
strace of upowerd none

Description Nicholai Cornilliac 2011-08-03 02:07:27 UTC
Description of problem:

Gnome 3 Battery Indicator / Upowerd problem
This affects system performance significantly.

This is a HP Probook 4510s Laptop. Other persons i have asked who are using Lenovo and Asus laptops do not get this problem. However they both arrived at F15 via upgrade from F14, unlike myself who has a freshly installed system.

Battery status icon disappears and re-appears while power adapter is plugged in. If I pull out the power cord and run on battery only, the battery icon will display properly and not disappear. I believe it is linked to upowerd because its CPU usage goes up and down while the power adapter is plugged in. This issue causes my laptop to perform "sticky" Here is my top output displaying that :

[nmc@nmc-fedora ~]$ top | grep upowerd
 1322 root      20   0 23176 8244 3068 R 57.3  0.4   0:50.13 upowerd            
 1322 root      20   0 23176 8244 3068 R 99.5  0.4   0:50.81 upowerd            
 1322 root      20   0 23176 8244 3068 S  1.5  0.4   0:50.82 upowerd            
 1322 root      20   0 23176 8244 3068 R 44.7  0.4   0:51.84 upowerd            
 1322 root      20   0 23176 8244 3068 S 25.4  0.4   0:51.95 upowerd            
 1322 root      20   0 23176 8244 3068 S  0.3  0.4   0:51.96 upowerd            
 1322 root      20   0 23176 8244 3068 R  5.3  0.4   0:52.12 upowerd            
 1322 root      20   0 23176 8244 3068 S 32.2  0.4   0:53.09 upowerd            
 1322 root      20   0 23176 8244 3068 S  0.3  0.4   0:53.10 upowerd            
 1322 root      20   0 23344 8244 3068 S 36.9  0.4   0:54.21 upowerd            
 1322 root      20   0 23344 8244 3068 S  0.3  0.4   0:54.22 upowerd            
 1322 root      20   0 23344 8296 3068 S 37.6  0.4   0:55.35 upowerd            
 1322 root      20   0 23344 8296 3068 S  0.3  0.4   0:55.36 upowerd            
 1322 root      20   0 23344 8296 3068 R  7.3  0.4   0:55.58 upowerd            
 1322 root      20   0 23344 8296 3068 S 29.9  0.4   0:56.48 upowerd            
 1322 root      20   0 23344 8296 3068 S  0.3  0.4   0:56.49 upowerd            
 1322 root      20   0 23344 8372 3068 S 37.2  0.4   0:57.61 upowerd            
 1322 root      20   0 23344 8372 3068 S 37.2  0.4   0:58.73 upowerd



Version-Release number of selected component (if applicable):

This is a HP Probook 4510s Laptop.

2.6.38.8-35.fc15.i686.PAE
upower-0.9.12-1.fc15.i686


How reproducible: Anytime the power adapter is plugged in.


Steps to Reproduce:
1. Plug in power adapter
2. Look at the battery indicator
3. See it disappear, then re-appear .. over and over
  
Actual results: 
Battery Icon disappears and re-appears, upowerd cpu usage goes up and down.


Expected results:
Battery Icon disappears and re-appears, upowerd cpu usage goes up and down.

Additional info:

Comment 1 Richard Hughes 2011-08-03 08:16:16 UTC
Can you try (as root)

killall upowerd
/usr/libexec/upowerd --verbose

And then try to reproduce the problem. You should get a whole heap of debugging data, in which case please attach it to this bug. Thanks.

Comment 2 Nicholai Cornilliac 2011-08-03 13:18:40 UTC
Created attachment 516514 [details]
/usr/libexec/upowerd --verbose

Comment 3 Richard Hughes 2011-08-03 13:24:39 UTC
This is a kernel problem; /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 is being removed and re-added over and over again. Reassigning.

Comment 4 Dave Jones 2011-09-01 17:10:33 UTC
I suspect a start would be to get the output of acpidump from pmtools.

Comment 5 Dave Jones 2011-09-01 17:10:56 UTC
also, does this still happen with 2.6.40.3 ?

Comment 6 Nicholai Cornilliac 2011-09-01 17:18:40 UTC
Yes, it does still happen with 2.6.40.3

Comment 7 Nicholai Cornilliac 2011-09-01 17:23:22 UTC
if im doing the acpidump, would you like the output in hex or binary ?

Comment 8 Matthew Garrett 2011-09-01 17:26:10 UTC
Just run acpidump without any arguments.

Comment 9 Nicholai Cornilliac 2011-09-01 17:34:19 UTC
Created attachment 521065 [details]
acpidump

here is the output from my acpidump

Comment 10 borysjr 2011-11-02 16:45:05 UTC
Hi, I have the same problem. Using Fedora 15 (fresh install, fully updated), HP Compaq 615 laptop. I'll add my output also. Ty.

Comment 11 borysjr 2011-11-02 17:08:58 UTC
Hi, I have the same problem. Using Fedora 15 (fresh install, fully updated), HP Compaq 615 laptop. I'll add my output also. Ty.

Comment 12 Martin Wilck 2012-04-26 14:54:35 UTC
Seeing a similar thing here on a Fujitsu laptop (ESPRIMO Mobile M9400).

upowerd constanly consuming 50% CPU (i.e. 1 full CPU core). This happened to me the first time today, apparently after running out of battery in a conference call and plugging the laptop back into AC power.

This made GNOME3 totally unresponsive. On the text console and under GNOME2 legacy mode with Compiz, working was possible. gdm login was extremely sluggish (close to unusable), thus I'm working from a GNOME2 legacy session started via startx now.

Comment 13 Martin Wilck 2012-04-26 15:00:34 UTC
Created attachment 580504 [details]
/var/lib/upower/history-charge-Modelxxx-57.dat

This upowerd history file shows that, similar to what was  stated in BZ before, the battery seems to disappear and reappear again.

I've been running Fedora on this laptop since F13, (F16 for about 3 months), and this never happened to me before (fortunately, because it's easily one of the most annoying things that ever happened to me using Linux). This problem wouldn't even go away by power-cycling the machine.

While I'm typing this, upowerd seems to have settled down. I'll try logging in with GNOME3 again. See what happens.

Comment 14 Martin Wilck 2012-04-26 16:44:19 UTC
Looking at the kernel code in acpi_battery_update(), there are 2 code paths where sysfs_remove_battery() / sysfs_add_battery() is called.

The first is in acpi_battery_update(), when the battery_present bit (0x10) returned by the _STA method of the battery device changes. This could be caused by hardware or firmware defects - at least the acpidump of comment #9 and from my own laptop suggest that the return value is dynamic and dependent on some registers of the embedded controller. However this degree of broken-ness seems pretty unlikely on various laptops of well-known manufacturers. Does it really make sense to tie the presence of the entire sysfs directory to the "battery present" bit?

The second is acpi_battery_refresh(), which is called whenever a ACPI_BATTERY_NOTIFY_INFO event is received (indicating that *static* battery info has changed). If such events happen often (I guess if that happens, it would also indicate a firmware problem) the sysfs dir might be removed and re-added frequently. It might by better to check whether re-adding is really necessary (i.e if the power_unit of the battery device changed).

Comment 15 Martin Wilck 2012-04-26 16:46:53 UTC
Created attachment 580520 [details]
tentative patch for the acpi_battery_refresh() case

This is just to illustrate my thoughts on the second possible reason why the sysfs directory keeps being removed and re-added.

Comment 16 Martin Wilck 2012-04-26 16:52:42 UTC
Created attachment 580521 [details]
strace of upowerd

This strace (captured while I was seeing the problem) demonstrates that /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0/ actually goes away and reappears. It also shows that upowerd seems to read the sysfs files many times in a row in a very short timespan, indicating room for improvement in that area as well.

Comment 17 Josh Boyer 2012-07-11 17:54:02 UTC
Fedora 15 has reached it's end of life as of June 26, 2012.  As a result, we will not be fixing any remaining bugs found in Fedora 15.

In the event that you have upgraded to a newer release and the bug you reported is still present, please reopen the bug and set the version field to the newest release you have encountered the issue with.  Before doing so, please ensure you are testing the latest kernel update in that release and attach any new and relevant information you may have gathered.

Thank you for taking the time to file a report.  We hope newer versions of Fedora suit your needs.