After resume, showing 2 batteries even though only one installed

Bug #828273 reported by Joe Barnett
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Fedora
Fix Released
Undecided
upower (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After resuming from suspend, gnome is showing 2 batteries in the power status area even though only one installed. one is charging/charged w/ the correct %age, the other has a (x) icon next to it.

unplugging and replugging power cable makes the 2nd one disappear.

upower -d after resume:

$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_ACAD
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD
  power supply: yes
  updated: Tue Aug 16 08:13:25 2011 (98558 seconds ago)
  has history: no
  has statistics: no
  line-power
    online: yes

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor: Hewlett-Packard
  model: Primary
  power supply: yes
  updated: Wed Aug 17 07:53:56 2011 (13327 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: fully-charged
    energy: 50.7936 Wh
    energy-empty: 0 Wh
    energy-full: 50.7936 Wh
    energy-full-design: 53.28 Wh
    energy-rate: 0 W
    voltage: 12.491 V
    percentage: 100%
    capacity: 95.3333%
    technology: lithium-ion

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1
  power supply: no
  updated: Wed Aug 17 11:35:43 2011 (20 seconds ago)
  has history: no
  has statistics: no
  battery
    present: no
    rechargeable: no
    state: unknown
    energy: 0 Wh
    energy-empty: 0 Wh
    energy-full: 0 Wh
    energy-full-design: 0 Wh
    energy-rate: 0 W
    percentage: 0%

Daemon:
  daemon-version: 0.9.12
  can-suspend: yes
  can-hibernate yes
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: yes
  is-docked: no

upower -d after unplug/replug:

$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_ACAD
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD
  power supply: yes
  updated: Wed Aug 17 11:36:48 2011 (1 seconds ago)
  has history: no
  has statistics: no
  line-power
    online: no

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor: Hewlett-Packard
  model: Primary
  power supply: yes
  updated: Wed Aug 17 11:36:49 2011 (0 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: discharging
    energy: 50.7936 Wh
    energy-empty: 0 Wh
    energy-full: 50.7936 Wh
    energy-full-design: 53.28 Wh
    energy-rate: 0 W
    voltage: 12.489 V
    percentage: 100%
    capacity: 95.3333%
    technology: lithium-ion
  History (charge):
    1313606208 100.000 fully-charged
    1313606208 0.000 unknown
  History (rate):
    1313606208 0.000 unknown

Daemon:
  daemon-version: 0.9.12
  can-suspend: yes
  can-hibernate yes
  on-battery: yes
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: yes
  is-docked: no

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: upower 0.9.12-1
ProcVersionSignature: Ubuntu 3.0.0-8.11-generic 3.0.1
Uname: Linux 3.0.0-8-generic x86_64
Architecture: amd64
Date: Wed Aug 17 11:37:19 2011
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: upower
UpgradeStatus: Upgraded to oneiric on 2011-07-13 (34 days ago)

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

Description of problem:

I see two batteries in the battery information panel in gnome-shell. One of them is at 0%. upower --dump and sysfs also show two batteries so it seems to be the kernel that is at fault here.

This is a Dell Latitude E4300 laptop

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

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

lrwxrwxrwx 1 root root 0 april 7 15:36 AC -> ../../devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
lrwxrwxrwx 1 root root 0 april 7 14:26 BAT0 -> ../../devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
lrwxrwxrwx 1 root root 0 april 7 14:26 BAT1 -> ../../devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1

[kmaraas@e4300 upower (master)]$ dmesg | grep -i battery
[ 0.841579] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
[ 0.841585] ACPI: Battery Slot [BAT0] (battery present)
[ 0.841607] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
[ 0.841612] ACPI: Battery Slot [BAT1] (battery absent)

Revision history for this message
In , Chuck (chuck-redhat-bugs) wrote :

(In reply to comment #1)
> [ 0.841612] ACPI: Battery Slot [BAT1] (battery absent)

That's just the empty slot for the second battery (the one that clips to the bottom of the machine.)

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

Going to go out on a limb here and reopen this because it's causing real problems for me.

The second "battery" only shows up after resume from suspend and sometimes I end up with a laptop that just suspends immediately because the empty battery slot is at 0% capasity and thus triggers an emergency suspend.

I haven't even had the machine in the docking station so I don't see why it should show up at all.

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

If it appears again can you please do:

grep . /sys/class/power_supply/*/*

and attach the output here?

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :
Download full text (4.8 KiB)

Here's the output. The first is before suspend the other is after resume:

[kmaraas@e4300 po (master)]$ grep . /sys/class/power_supply/*/*
/sys/class/power_supply/AC/online:1
/sys/class/power_supply/AC/type:Mains
/sys/class/power_supply/AC/uevent:POWER_SUPPLY_NAME=AC
/sys/class/power_supply/AC/uevent:POWER_SUPPLY_ONLINE=1
/sys/class/power_supply/BAT0/alarm:0
/sys/class/power_supply/BAT0/charge_full:4126000
/sys/class/power_supply/BAT0/charge_full_design:5600000
/sys/class/power_supply/BAT0/charge_now:5600000
/sys/class/power_supply/BAT0/current_now:1000
/sys/class/power_supply/BAT0/cycle_count:0
/sys/class/power_supply/BAT0/manufacturer:SMP
/sys/class/power_supply/BAT0/model_name:DELL H986297
/sys/class/power_supply/BAT0/present:1
/sys/class/power_supply/BAT0/serial_number:834
/sys/class/power_supply/BAT0/status:Full
/sys/class/power_supply/BAT0/technology:Li-ion
/sys/class/power_supply/BAT0/type:Battery
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_NAME=BAT0
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_STATUS=Full
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_PRESENT=1
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_TECHNOLOGY=Li-ion
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CYCLE_COUNT=0
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_NOW=12788000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CURRENT_NOW=1000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL_DESIGN=5600000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL=4126000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_NOW=5600000
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MODEL_NAME=DELL H986297
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MANUFACTURER=SMP
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_SERIAL_NUMBER=834
/sys/class/power_supply/BAT0/voltage_min_design:11100000
/sys/class/power_supply/BAT0/voltage_now:12788000
[kmaraas@e4300 po (master)]$ grep . /sys/class/power_supply/*/*
/sys/class/power_supply/AC/online:1
/sys/class/power_supply/AC/type:Mains
/sys/class/power_supply/AC/uevent:POWER_SUPPLY_NAME=AC
/sys/class/power_supply/AC/uevent:POWER_SUPPLY_ONLINE=1
/sys/class/power_supply/BAT0/alarm:0
/sys/class/power_supply/BAT0/charge_full:4126000
/sys/class/power_supply/BAT0/charge_full_design:5600000
/sys/class/power_supply/BAT0/charge_now:5600000
/sys/class/power_supply/BAT0/current_now:1000
/sys/class/power_supply/BAT0/cycle_count:0
/sys/class/power_supply/BAT0/manufacturer:SMP
/sys/class/power_supply/BAT0/model_name:DELL H986297
/sys/class/power_supply/BAT0/present:1
/sys/class/power_supply/BAT0/serial_number:834
/sys/class/power_supply/BAT0/status:Full
/sys/class/power_supply/BAT0/technology:Li-ion
/sys/class/power_supply/BAT0/type:Battery
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_NAME=BAT0
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_STATUS=Full
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_PRESENT=1
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_TECHNOLOGY=Li-ion
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CYCLE_COUNT=0
/sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
/sys/...

Read more...

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Ok, so that all looks nominally fine - the question is why upower thinks it's present. When you're in the "good" state can you (as root) run

udevadm monitor

and then suspend/resume, and if the problem appears attach the udevadm output? It would also help to have the output of the acpidump command from the pmtools package.

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :
Download full text (9.0 KiB)

[kmaraas@e4300 Nedlasting]$ sudo udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1302773968.491059] add /devices/virtual/vc/vcs63 (vc)
KERNEL[1302773968.491090] add /devices/virtual/vc/vcsa63 (vc)
UDEV [1302773968.505074] add /devices/virtual/vc/vcs63 (vc)
UDEV [1302773968.506642] add /devices/virtual/vc/vcsa63 (vc)
KERNEL[1302773984.460743] remove /devices/system/cpu/cpu1/cpufreq (cpu)
KERNEL[1302773984.460770] remove /devices/system/cpu/cpu1/cache/index0 (cpu)
KERNEL[1302773984.460803] remove /devices/system/cpu/cpu1/cache/index1 (cpu)
KERNEL[1302773984.460817] remove /devices/system/cpu/cpu1/cache/index2 (cpu)
KERNEL[1302773984.460831] remove /devices/system/cpu/cpu1/cache (cpu)
KERNEL[1302773984.460845] remove /devices/system/machinecheck/machinecheck1 (machinecheck)
KERNEL[1302773984.460860] add /devices/system/cpu/cpu1/cache/index0 (cpu)
KERNEL[1302773984.460874] add /devices/system/cpu/cpu1/cache/index1 (cpu)
KERNEL[1302773984.460888] add /devices/system/cpu/cpu1/cache/index2 (cpu)
KERNEL[1302773984.460901] add /devices/system/cpu/cpu1/cache (cpu)
KERNEL[1302773984.460916] add /devices/system/machinecheck/machinecheck1 (machinecheck)
KERNEL[1302773984.460930] add /devices/system/cpu/cpu1/cpufreq (cpu)
KERNEL[1302773984.460947] change /devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC (power_supply)
KERNEL[1302773984.460965] remove /devices/platform/i8042/serio0/input/input3/event3 (input)
KERNEL[1302773984.460997] remove /devices/platform/i8042/serio0/input/input3 (input)
KERNEL[1302773984.461020] add /devices/platform/i8042/serio0/input/input15 (input)
KERNEL[1302773984.461038] add /devices/platform/i8042/serio0/input/input15/event3 (input)
KERNEL[1302773984.461072] remove /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[1302773984.461101] add /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[1302773984.461129] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[1302773984.461147] change /devices/platform/dell-laptop/rfkill/rfkill0 (rfkill)
KERNEL[1302773984.461163] change /devices/platform/dell-laptop/rfkill/rfkill1 (rfkill)
KERNEL[1302773984.461180] change /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.3/3-1.3:1.0/bluetooth/hci0/rfkill2 (rfkill)
UDEV [1302773984.471283] remove /devices/system/cpu/cpu1/cache/index0 (cpu)
UDEV [1302773984.471639] remove /devices/system/cpu/cpu1/cpufreq (cpu)
UDEV [1302773984.472255] add /devices/system/cpu/cpu1/cpufreq (cpu)
UDEV [1302773984.472627] remove /devices/system/cpu/cpu1/cache/index1 (cpu)
UDEV [1302773984.473181] remove /devices/platform/i8042/serio0/input/input3/event3 (input)
UDEV [1302773984.474144] remove /devices/system/machinecheck/machinecheck1 (machinecheck)
UDEV [1302773984.474724] change /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.3/3-1.3:1.0/bluetooth/hci0/rfkill2 (rfkill)
UDEV [1302773984.475185] change /devices/platform/dell-laptop/rfkill/rfkil...

Read more...

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

acpidump output is the same before and after suspend/resume

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

Created attachment 492014
acpidump output before suspend

Revision history for this message
In , Chuck (chuck-redhat-bugs) wrote :

(In reply to comment #7)
> KERNEL[1302773984.503188] remove
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> KERNEL[1302773984.503240] add
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> KERNEL[1302773984.503310] change
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> KERNEL[1302773984.503377] add
> /devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1 (power_supply)
> KERNEL[1302773984.503419] change
> /devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1 (power_supply)
> UDEV [1302773984.508888] remove
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> UDEV [1302773984.516922] add
> /devices/platform/i8042/serio0/input/input15/event3 (input)
> UDEV [1302773984.517381] add
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> UDEV [1302773984.517890] change
> /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
> UDEV [1302773984.518399] add
> /devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1 (power_supply)
> UDEV [1302773984.519722] change
> /devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1 (power_supply)

So we do remove/add/change (twice?) for BAT0, and just add/change for BAT1. BAT1 doesn't really exist, maybe udev is confused by the empty slot?

Revision history for this message
In , Chuck (chuck-redhat-bugs) wrote :

(In reply to comment #3)
>
> I haven't even had the machine in the docking station so I don't see why it
> should show up at all.

What does this have to do with docking stations? The second battery clips to the machine and the slot for it (really just the connectors on the bottom of the machine) is always present.

Revision history for this message
In , Kjartan (kjartan-redhat-bugs) wrote :

Just ignore my comment about docking station. I misread your comment about the second battery and connectors.

Revision history for this message
In , Chuck (chuck-redhat-bugs) wrote :

*** Bug 698189 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Rui (rui-redhat-bugs) wrote :

This is also happening on a Dell Latitude D630 with kernel 2.6.39-0.rc7.git0.0.fc16.x86_64 and current F15 user land.

Revision history for this message
In , Trevor (trevor-redhat-bugs) wrote :

*** Bug 709040 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Albert (albert-redhat-bugs-1) wrote :

This happens on my Dell Latitude E6500 too, Fedora 15 latest updates. Please shout if I can provide more information.

Revision history for this message
In , Chuck (chuck-redhat-bugs) wrote :

*** Bug 717573 has been marked as a duplicate of this bug. ***

Revision history for this message
Joe Barnett (thejoe) wrote :
Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Happens on my E6410 also (kernel-2.6.40.4-5.fc15.x86_64).

 I think this should really be a higher priority, as it makes the machine virtually unusable as a portable device. The extra battery shows up after suspend/resume whether the machine is plugged in, docked, or on battery. Once it does, the machine can't be disconnected from power without it hibernating.

Revision history for this message
In , Steven (steven-redhat-bugs) wrote :

I have a workaround (documented in bug #704110) using a resume hook in /etc/pm/sleep.d that reads out battery state from /proc/acpi/battery/BAT*. Note that, although deprecated, using that interface causes the phantom battery to disappear afterwards. Reading state from /sys/class/power_supply does nothing in that respect.

See https://bugzilla.redhat.com/show_bug.cgi?id=704110#c12

Since using that, I have had no more phantom battery or shutdown-upon-resume issues.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upower (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier.Cardoso@gmail.com (olivier-cardoso) wrote :

Same problem on a DELL E6410 both on 11.04 and 11.10 with gnome-shell, except that unplug / plug power cable as no effect.

 upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
  power supply: yes
  updated: Mon Oct 17 23:31:22 2011 (109 seconds ago)
  has history: no
  has statistics: no
  line-power
    online: yes

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor: Sanyo
  model: DELL RG04909
  serial: 2276
  power supply: yes
  updated: Mon Oct 17 23:31:28 2011 (103 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: fully-charged
    energy: 62.16 Wh
    energy-empty: 0 Wh
    energy-full: 62.16 Wh
    energy-full-design: 62.16 Wh
    energy-rate: 0.0111 W
    voltage: 12.635 V
    percentage: 100%
    capacity: 90%
    technology: lithium-ion
  History (charge):
    1318887084 100.000 fully-charged
    1318887082 86.054 charging
  History (rate):
    1318887084 0.011 fully-charged
    1318887082 0.000 charging

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:01/power_supply/BAT1
  power supply: no
  updated: Mon Oct 17 23:32:58 2011 (13 seconds ago)
  has history: no
  has statistics: no
  battery
    present: no
    rechargeable: no
    state: unknown
    energy: 0 Wh
    energy-empty: 0 Wh
    energy-full: 0 Wh
    energy-full-design: 0 Wh
    energy-rate: 0 W
    percentage: 0%

Daemon:
  daemon-version: 0.9.13
  can-suspend: yes
  can-hibernate yes
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: yes
  is-docked: no

Revision history for this message
Colm Ryan (metmywaterloo) wrote :

I can confirm this bug on a Dell E6420 where I repeatedly see two phantom batteries after a suspend/resume cycle. This leads to the forced hibernate which is frustrating. The fix from Steven Bakker at this bug report (https://bugzilla.redhat.com/show_bug.cgi?id=704110#c12) fixed it for me but it seems like a hack workaround rather than a proper fix for gpm.

Revision history for this message
In , Josh (josh-redhat-bugs) wrote :

Is this still happening with 2.6.43/3.3 in F15/F16?

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Doesn't seem to occur on a fresh install of F17 w/ kernel-3.3.7-1.fc17.x86_64.

Revision history for this message
In , Josh (josh-redhat-bugs) wrote :

(In reply to comment #21)
> Doesn't seem to occur on a fresh install of F17 w/
> kernel-3.3.7-1.fc17.x86_64.

OK. Thanks for letting us know.

Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.