Bug 15482 - HAL shows battery twice on PMU
Summary: HAL shows battery twice on PMU
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: PowerPC Linux (All)
: medium normal
Assignee: Danny Kukawka
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-13 05:33 UTC by Christian Schmitt
Modified: 2008-08-11 02:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
output of lshal on my PPC machine (75.55 KB, text/plain)
2008-04-14 07:26 UTC, Christian Schmitt
Details
Patch to add proc PMU-battery only if not available via sysfs (power_supply) (1.41 KB, patch)
2008-04-14 07:29 UTC, Danny Kukawka
Details | Splinter Review
output after applying the patch (75.35 KB, text/plain)
2008-04-14 07:48 UTC, Christian Schmitt
Details

Description Christian Schmitt 2008-04-13 05:33:03 UTC
HAL-0.5.10 and 0.5.11rc2 both show the battery of my iBook G4 twice in kpowersave. I compiled HAL with PMU support and disabled all APM stuff (emulation) in the kernel (2.6.24). I also installed the latest version of hal-info, but that didn't change it either.

Here is the output of "lshal | grep battery":

udi = '/org/freedesktop/Hal/devices/pmu_battery_0_0'
  battery.charge_level.current = 1938  (0x792)  (int)
  battery.charge_level.design = 4316  (0x10dc)  (int)
  battery.charge_level.last_full = 4316  (0x10dc)  (int)
  battery.charge_level.percentage = 44  (0x2c)  (int)
  battery.charge_level.rate = 1980  (0x7bc)  (int)
  battery.is_rechargeable = true  (bool)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.remaining_time = 4323  (0x10e3)  (int)
  battery.technology = 'unknown'  (string)
  battery.type = 'primary'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pmu_battery_0_0'  (string)
  linux.pmu_path = '/proc/pmu/battery_0'  (string)
  linux.sysfs_path = '/sys/devices/platform/pmu-battery.0/power_supply/pmu-ac'  (string)
udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_PMU_battery_0'
  battery.charge_level.current = 1930  (0x78a)  (int)
  battery.charge_level.design = 0  (0x0)  (int)
  battery.charge_level.last_full = 4316  (0x10dc)  (int)
  battery.charge_level.percentage = 44  (0x2c)  (int)
  battery.charge_level.rate = 1980  (0x7bc)  (int)
  battery.is_rechargeable = true  (bool)
  battery.model = 'Smart'  (string)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.remaining_time = 4338  (0x10f2)  (int)
  battery.reporting.current = 1930  (0x78a)  (int)
  battery.reporting.last_full = 4316  (0x10dc)  (int)
  battery.reporting.rate = 1980  (0x7bc)  (int)
  battery.reporting.unit = 'mWh'  (string)
  battery.technology = 'unknown'  (string)
  battery.type = 'primary'  (string)
  battery.voltage.current = 11791  (0x2e0f)  (int)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_PMU_battery_0'  (string)
  linux.sysfs_path = '/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0'  (string)
udi = '/org/freedesktop/Hal/devices/platform_pmu_battery_0'
  info.product = 'Platform Device (pmu-battery.0)'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_pmu_battery_0'  (string)
  linux.sysfs_path = '/sys/devices/platform/pmu-battery.0'  (string)
  platform.id = 'pmu-battery.0'  (string)
Comment 1 Danny Kukawka 2008-04-14 06:01:04 UTC
Please attach the full output of lshal
Comment 2 Christian Schmitt 2008-04-14 07:26:03 UTC
Created attachment 15906 [details]
output of lshal on my PPC machine
Comment 3 Danny Kukawka 2008-04-14 07:29:52 UTC
Created attachment 15907 [details] [review]
Patch to add proc PMU-battery only if not available  via sysfs (power_supply)

Please try this patch agains git/0.5.11-RC2
Comment 4 Christian Schmitt 2008-04-14 07:48:07 UTC
Created attachment 15908 [details]
output after applying the patch
Comment 5 Christian Schmitt 2008-04-14 13:08:14 UTC
So, just for the sake of completeness and as information for everybody:

The problem of the battery shown twice is caused by the sysfs power_supply option in the kernel. Disabling it makes everything work as expected immediately. The sysfs device is not yet aware of the AC events. So until this gets fixed, we need to go with the /proc approach.

The kernel guys know of it and will probably do something about it...
Comment 6 Danny Kukawka 2008-08-11 02:48:35 UTC
Commited fix to git.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.