Resending a message i sent before joining the maillist som i am sorry if this becomes a double post.
Ok, i am not sure but i think there is something wrong in the logic around when not to poll the battery anymore. The symptoms I experience is that if I have a battery that is fully charged and disconnect the AC supply in my Acer aspire one. The battery status never updates in upower. Running upower --monitor-detail Monitoring activity from the power daemon. Press Ctrl+C to cancel. [21:10:37.083] device changed: /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 vendor: SIMPLO model: UM08A73 serial: 00A3 power supply: yes updated: Mon Jun 20 21:10:37 2011 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 12.7539 Wh energy-empty: 0 Wh energy-full: 12.7539 Wh energy-full-design: 24.42 Wh energy-rate: 0 W voltage: 12.311 V percentage: 100% capacity: 52.2273% technology: lithium-ion [21:10:37.093] device changed: /org/freedesktop/UPower/devices/line_power_ACAD native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD power supply: yes updated: Mon Jun 20 21:10:37 2011 (0 seconds ago) has history: no has statistics: no line-power online: no [21:10:37.552] device changed: /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 vendor: SIMPLO model: UM08A73 serial: 00A3 power supply: yes updated: Mon Jun 20 21:10:37 2011 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 12.7539 Wh energy-empty: 0 Wh energy-full: 12.7539 Wh energy-full-design: 24.42 Wh energy-rate: 0 W voltage: 12.311 V percentage: 100% capacity: 52.2273% technology: lithium-ion [21:10:38.787] device changed: /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 vendor: SIMPLO model: UM08A73 serial: 00A3 power supply: yes updated: Mon Jun 20 21:10:38 2011 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 12.7539 Wh energy-empty: 0 Wh energy-full: 12.7539 Wh energy-full-design: 24.42 Wh energy-rate: 0 W voltage: 12.311 V percentage: 100% capacity: 52.2273% technology: lithium-ion [21:10:39.778] device changed: /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 vendor: SIMPLO model: UM08A73 serial: 00A3 power supply: yes updated: Mon Jun 20 21:10:39 2011 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 12.7539 Wh energy-empty: 0 Wh energy-full: 12.7539 Wh energy-full-design: 24.42 Wh energy-rate: 0 W voltage: 12.311 V percentage: 100% capacity: 52.2273% technology: lithium-ion [21:10:40.795] device changed: /org/freedesktop/UPower/devices/battery_BAT1 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1 vendor: SIMPLO model: UM08A73 serial: 00A3 power supply: yes updated: Mon Jun 20 21:10:40 2011 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 12.7539 Wh energy-empty: 0 Wh energy-full: 12.7539 Wh energy-full-design: 24.42 Wh energy-rate: 0 W voltage: 12.311 V percentage: 100% capacity: 52.2273% technology: lithium-ion The state does not change from fully charged to discharging until a few seconds later. This causes the logic to fail when the battery is fully charged in the function up_device_supply_refresh_battery the logic is that /* only disable the polling if the kernel tells us we're fully charged, not if we've guessed the state to be fully charged */ supply->priv->enable_poll = (state != UP_DEVICE_STATE_FULLY_CHARGED); so the poll is disabled since the last run through the function is when the battery reports fully charged. The polling is never reenabled the function setup poll which is run in up_device_supply_refresh just exits if the enable_poll is false, which is I feel not the intended function, considering the comment on the lines before the setup_poll is called. /* Seems that we don't get change uevents from the * kernel on some BIOS types */ I would like to see a change either in setup_poll to reenable the poll independent of the enable_poll state, or even resetting it to enabled, or do not disable the enable_poll unless the state is UP_DEVICE_STATE_FULLY_CHARGED AND AC power is online. Hope I have understood this correctly, there is a bug report on this launchpad https://bugs.launchpad.net/ubuntu/+source/upower/+bug/467825 where a few people are affected. I have tested by simply commenting out the offending line in linux/up-device-supply.c and it works, it takes some 30s but at least the battery status updates after a full charge and unplug. Best regards Mikael Hjelm
_______________________________________________ devkit-devel mailing list devkit-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/devkit-devel