Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212859 - sys-apps/hal reports two batteries w/ 2.6.24 kernels
Summary: sys-apps/hal reports two batteries w/ 2.6.24 kernels
Status: RESOLVED DUPLICATE of bug 203306
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Linux bug wranglers
URL: http://dkukawka.blogspot.com/2008/01/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-09 18:42 UTC by Stafford Brunk
Modified: 2008-03-25 06:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Backported fixes for non-updating battery when CONFIG_SYSFS_POWER is enabled. (hal-0.5.10-sysfs-battery-fixes.patch,20.61 KB, patch)
2008-03-25 00:56 UTC, Kyle Schaffrick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stafford Brunk 2008-03-09 18:42:12 UTC
On 2.6.24 kernels with ACPI_PROCFS_POWER and ACPI_SYSFS_POWER enabled, sys-apps/hal reports two batteries, one from sysfs and one from procfs.  This is on a system with one physical battery.  This breaks battery functionality on laptops for battery management daemons (like kpowersave) cannot accurately calculate remaining battery life and discharge rate.  The linked blog post from Danny Kukawka talks of patches that fix this behavior.  This happens on sys-apps/hal-0.5.10 and lower.

Reproducible: Always

Steps to Reproduce:
1. Configure a 2.6.24 kernel with ACPI_PROCFS_POWER and ACPI_SYSFS_POWER enabled
2. Install sys-apps/hal
3. Install sys-power/kpowersave or similar battery life utility that relies on hal for information (>=sys-apps/kpowersave-0.7.3 no longer rely on powersaved)

Actual Results:  
kpowersave will report two batteries, one that dischages with system usage and one that remains at full power with 0.00 hours remaining.

Expected Results:  
kpowersave should report the correct number of physical batteries as well as the correct power consumption and battery life remaining.

See the blog post for information regarding the patches.
http://dkukawka.blogspot.com/2008/01/hal-sysfs-acpi-batteries-fixed.html

emerge --info
Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-tuxonice-r3 x86_64)
=================================================================
System uname: 2.6.24-tuxonice-r3 x86_64 Genuine Intel(R) CPU @ 2.60GHz
Timestamp of tree: Sun, 09 Mar 2008 17:16:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -fomit-frame-pointer -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://prometheus.cs.wmich.edu/gentoo http://mirror.mcs.anl.gov/        pub/gentoo/ "
LC_ALL="en_US"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/berkano /usr/portage/local/layman/wschlich-testing /usr/portage/local/layman/desktop-effects /usr/portage/local/layman/custom-kernels /usr/portage/local/layman/einit /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bzip2 cli cpudetection cracklib crypt dbus divx dri dts dvd fortran gdbm gpm gtk gtk2 hal iconv ipv6 isdnlog java jpeg kde kdeenablefinal mad midi mmx mmx2 mp3 mp4 mudflap mysql ncurses nls nptl nptlonly nvidia ogg openal opengl openmp oss pam pcre pdf perl png pppd python qt3 qt4 quicktime readline reflection session spl sse sse2 sse3 ssl ssse3 svg symlink tcpd threads tiff tk truetype type1 unicode xml xorg xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 19:26:30 UTC

*** This bug has been marked as a duplicate of bug 203306 ***
Comment 2 Kyle Schaffrick 2008-03-25 00:56:47 UTC
Created attachment 147196 [details, diff]
Backported fixes for non-updating battery when CONFIG_SYSFS_POWER is enabled.

Here's a patch that contains the official fixes for this issue against 0.5.10. Works For Me (TM) ;-)
Comment 3 Stafford Brunk 2008-03-25 05:11:36 UTC
(In reply to comment #2)
> Created an attachment (id=147196) [edit]
> Backported fixes for non-updating battery when CONFIG_SYSFS_POWER is enabled.
> 
> Here's a patch that contains the official fixes for this issue against 0.5.10.
> Works For Me (TM) ;-)
> 

Thank you.  I had already applied such a patch myself I was just hoping that the ebuild devs would add it to the official ebuild.  The "official" solution is to disable the offending /proc iterfaces.
Comment 4 Kyle Schaffrick 2008-03-25 06:40:22 UTC
(In reply to comment #3)
> Thank you.  I had already applied such a patch myself I was just hoping that
> the ebuild devs would add it to the official ebuild.  The "official" solution
> is to disable the offending /proc iterfaces.

Yah, I also tried turning off the deprecated /proc interfaces, which of course fixes the duplicate battery problem, but I still end up with HAL not sending update events for the charge level, as described in the OP. So my battery indications stay stuck at 99%. The patch fixes both problems.

Cheers!