Bug 373041 - HAL reports incorrectly two batteries in an HPDV4000 laptop
Summary: HAL reports incorrectly two batteries in an HPDV4000 laptop
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: hal
Version: 8
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Zeuthen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-09 15:57 UTC by Fabio Comolli
Modified: 2013-03-06 03:53 UTC (History)
6 users (show)

Fixed In Version: 8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-08-01 23:52:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output of lshal (9.53 KB, application/x-gzip)
2007-11-09 15:57 UTC, Fabio Comolli
no flags Details


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 13669 0 None None None Never

Description Fabio Comolli 2007-11-09 15:57:02 UTC
Description of problem:

kpowersave shows two batteries while my laptop has one only. The cause seems to
be that HAL reports two batteries present in my laptop even if there's only one.

Version-Release number of selected component (if applicable): hal-0.5.10-1.fc8

How reproducible: always

Steps to Reproduce:
1. start kpowersave
  
Actual results:
It reports two batteries

Expected results:
It should report only one battery

Additional info:

The output of lshal shows that there are two UDI's with info.capabilities = {
'battery' }:

udi = '/org/freedesktop/Hal/devices/acpi_BAT0'
udi = '/org/freedesktop/Hal/devices/computer_power_supply_0'

the first one is the correct one.

A temporary fix for the problem is to clear info.capabilities for the 2nd entry:

hal-set-property --udi '/org/freedesktop/Hal/devices/computer_power_supply_0'
--key info.capabilities  --strlist-rem 'battery'

Comment 1 Fabio Comolli 2007-11-09 15:57:02 UTC
Created attachment 252951 [details]
Output of lshal

Comment 2 Orion Poplawski 2008-06-16 22:30:39 UTC
Any chance we can get this fixed?  This is basically happening on all laptops. 
Looks like a fix has been committed upstream.

Comment 3 W.C. Epperson 2008-07-10 01:42:33 UTC
Confirmed on Dell Latitude D600 (i386), showing 4 batteries with 2 installed. 
Severe impact is that the bogus entries (which do not show model or serial)
appear to report premature discharge, causing gnome-power-manager to fire
shutdown while actual batteries have plenty of charge left.  Forces use of
non-Linux OS for untethered operation.  The freedesktop.org external bug
referenced was closed as fixed in early March (and is for 

kernel-2.6.25.9-40.fc8
hal-0.5.10-3.fc8 just hit repos, does not fix.
hal-set-properties temporary fix noted in bug report does not fix.


Comment 4 Éric Brunet 2008-07-11 18:26:26 UTC
Same here with a Dell 630. The problem appeared with kernel 2.6.25.4-10.fc8 
which is the first with CONFIG_ACPI_SYSFS_POWER=y. The previous kernel,
2.6.24.7-92.fc8, has this option unset and works as expected.

I tried to recompile a hal with the patch found in 
http://lists.freedesktop.org/archives/hal-commit/2008-January/004133.html 
and indeed there was only one battery visible in hal and kpowermanager. 
However, kpowermanager was still confused and it would only update the charge 
level of the battery when a plug or an unplug event occured, and it was unable 
to compute or display the time remaining.

To me, it looks like the simplest fix is to unset the option 
CONFIG_ACPI_SYSFS_POWER in the kernel.


Comment 5 W.C. Epperson 2008-07-11 19:44:49 UTC
I suspect the core issue is the same as with Bug 454954, which also began
occurring with the first 2.6.25 kernel.

Comment 6 Kyle McMartin 2008-07-12 17:41:38 UTC
Please try the rpms I scratch built here with CONFIG_ACPI_SYSFS_POWER turned off
and let me know if it fixes the issues you've seen:
http://koji.fedoraproject.org/koji/taskinfo?taskID=710780

cheers, Kyle


Comment 7 Éric Brunet 2008-07-12 20:27:50 UTC
Yes, the kernel in kernel-2.6.25.10-91.fc9.i686.rpm does fix for me the issue 
with kpowermanager seeing two batteries; thanks for the rpm.

(Side note: I have fedora 8, your kernel is for fedora 9. While installing it, 
rpm complained about mkinitrd not recent enough. Installing with --nodeps, 
there was an error in the %posttrans scriplet. But it booted anyway and seems 
to be working very nicely.)

Comment 8 Kyle McMartin 2008-07-14 23:59:07 UTC
Ok, a F8 kernel is available here if that will help, but I guess it sorts out
your issue, and that the other bug might be unrelated.

http://koji.fedoraproject.org/koji/taskinfo?taskID=714370

cheers, Kyle

Comment 9 W.C. Epperson 2008-07-15 01:38:10 UTC
The build in task 714370 cures the two battery bug, and also breaks resume on
the Dell D6x0 due to inclusion of a 20-video-quirk-pm-dell.fdi with
<merge key="power_management.quirk.radeon_off" type="bool">true</merge>
missing under
<match key="system.hardware.product" contains_outof="D600;D610;D630">

This broken fdi began shipping with kernels at the same time that
CONFIG_ACPI_SYSFS_POWER was turned on.  Fortunately I'd already tracked it down
previously and knew how to fix it.  It's been reported to
hal.org.

This kernel unfortunately and surprisingly does not fix bug 454954, which also
began at the time CONFIG_ACPI_SYSFS_POWER was turned on.
 

Comment 10 Éric Brunet 2008-07-15 08:28:20 UTC
Hi,

I am happy with the FC9 kernel, and I won't try your FC8 kernel unless you 
think it is necessary. Do you ?

Thanks for fixing this bug.


Comment 11 Jason Tibbitts 2008-08-01 21:23:09 UTC
I'm pretty sure that this has been fixed now.  After updating to
kernel-2.6.25.11-60.fc8 I found that the phantom battery has disappeared.


Comment 12 W.C. Epperson 2008-09-15 02:04:04 UTC
The problem is back in 2.6.26.3-14.fc8.  This just bites.  Also see bug 452356.

Comment 13 Kyle McMartin 2008-09-15 02:21:38 UTC
Sorry, looks like the F9 kernel config got copied over the F8 one during an update, and this got turned back on. Fixed again. Really, should just fix Hal, but by the time that happens, F10 will be out and F8 will be gone.

regards, Kyle

Comment 14 W.C. Epperson 2008-09-15 15:20:29 UTC
And with any luck F10 won't have a broken network installer (preupgrade) and will have some of the missing stuff put back in (e.g. gdmsetup).  F9 has not been viable for us for those reasons.

By the time hal is fixed across the board, we'll have peace on earth.  I just had to patch my local 20-video quirk again.

Comment 15 W.C. Epperson 2008-10-02 22:49:03 UTC
And hooray, the fix finally made it to the F8 repo.
Fixed in 2.6.26.5-28.fc8.


Note You need to log in before you can comment on or make changes to this bug.