<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Resending a message i sent before joining the maillist som i am sorry if this becomes a double post.<br><br>Ok, i am not sure but i think there is something wrong in the logic around when not to poll the battery anymore. <br><br>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.<br><br>Running <br>upower --monitor-detail<br>Monitoring activity from the power daemon. Press Ctrl+C to cancel.<br>[21:10:37.083] device changed: /org/freedesktop/UPower/devices/battery_BAT1<br> native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1<br> vendor: SIMPLO<br> model: UM08A73<br> serial: 00A3<br> power supply: yes<br> updated: Mon Jun 20 21:10:37 2011 (0 seconds ago)<br> has history: yes<br> has statistics: yes<br> battery<br> present: yes<br> rechargeable: yes<br> state: fully-charged<br> energy: 12.7539 Wh<br> energy-empty: 0 Wh<br> energy-full: 12.7539 Wh<br> energy-full-design: 24.42 Wh<br> energy-rate: 0 W<br> voltage: 12.311 V<br> percentage: 100%<br> capacity: 52.2273%<br> technology: lithium-ion<br><br>[21:10:37.093] device changed: /org/freedesktop/UPower/devices/line_power_ACAD<br> native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ACAD<br> power supply: yes<br> updated: Mon Jun 20 21:10:37 2011 (0 seconds ago)<br> has history: no<br> has statistics: no<br> line-power<br> online: no<br><br>[21:10:37.552] device changed: /org/freedesktop/UPower/devices/battery_BAT1<br> native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1<br> vendor: SIMPLO<br> model: UM08A73<br> serial: 00A3<br> power supply: yes<br> updated: Mon Jun 20 21:10:37 2011 (0 seconds ago)<br> has history: yes<br> has statistics: yes<br> battery<br> present: yes<br> rechargeable: yes<br> state: fully-charged<br> energy: 12.7539 Wh<br> energy-empty: 0 Wh<br> energy-full: 12.7539 Wh<br> energy-full-design: 24.42 Wh<br> energy-rate: 0 W<br> voltage: 12.311 V<br> percentage: 100%<br> capacity: 52.2273%<br> technology: lithium-ion<br><br>[21:10:38.787] device changed: /org/freedesktop/UPower/devices/battery_BAT1<br> native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1<br> vendor: SIMPLO<br> model: UM08A73<br> serial: 00A3<br> power supply: yes<br> updated: Mon Jun 20 21:10:38 2011 (0 seconds ago)<br> has history: yes<br> has statistics: yes<br> battery<br> present: yes<br> rechargeable: yes<br> state: fully-charged<br> energy: 12.7539 Wh<br> energy-empty: 0 Wh<br> energy-full: 12.7539 Wh<br> energy-full-design: 24.42 Wh<br> energy-rate: 0 W<br> voltage: 12.311 V<br> percentage: 100%<br> capacity: 52.2273%<br> technology: lithium-ion<br><br>[21:10:39.778] device changed: /org/freedesktop/UPower/devices/battery_BAT1<br> native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1<br> vendor: SIMPLO<br> model: UM08A73<br> serial: 00A3<br> power supply: yes<br> updated: Mon Jun 20 21:10:39 2011 (0 seconds ago)<br> has history: yes<br> has statistics: yes<br> battery<br> present: yes<br> rechargeable: yes<br> state: fully-charged<br> energy: 12.7539 Wh<br> energy-empty: 0 Wh<br> energy-full: 12.7539 Wh<br> energy-full-design: 24.42 Wh<br> energy-rate: 0 W<br> voltage: 12.311 V<br> percentage: 100%<br> capacity: 52.2273%<br> technology: lithium-ion<br><br>[21:10:40.795] device changed: /org/freedesktop/UPower/devices/battery_BAT1<br> native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT1<br> vendor: SIMPLO<br> model: UM08A73<br> serial: 00A3<br> power supply: yes<br> updated: Mon Jun 20 21:10:40 2011 (0 seconds ago)<br> has history: yes<br> has statistics: yes<br> battery<br> present: yes<br> rechargeable: yes<br> state: fully-charged<br> energy: 12.7539 Wh<br> energy-empty: 0 Wh<br> energy-full: 12.7539 Wh<br> energy-full-design: 24.42 Wh<br> energy-rate: 0 W<br> voltage: 12.311 V<br> percentage: 100%<br> capacity: 52.2273%<br> technology: lithium-ion<br><br><br><br>The state does not change from fully charged to discharging until a few seconds later. <br>This causes the logic to fail when the battery is fully charged in the function <br>up_device_supply_refresh_battery<br>the logic is that <br>
<br>/* only disable the polling if the kernel tells us we're fully charged,<br> not if we've guessed the state to be fully charged */<br> supply->priv->enable_poll = (state != UP_DEVICE_STATE_FULLY_CHARGED);<br><br>so the poll is disabled since the last run through the function is when the battery reports fully charged. <br><br><br>The polling is never reenabled the function setup poll which is run in up_device_supply_refresh<br>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. <br>/* Seems that we don't get change uevents from the<br> * kernel on some BIOS types */<br><br><br>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. <br><br>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.<br><br>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. <br><br><br><br>Best regards Mikael Hjelm<br>                                            </div></body>
</html>