The issue here is a bug in the bq27541 fuel gauge driver. The get_property() function is not thread-safe, but reentry is possible in several different scenarios.
The attached patch fixes this issue by protecting get_property() via a mutex. Below is the patch commit message, for clarity: * Currently, get_property() and its callees are not thread-safe, since they share some global state, which they access without serialization or guaranteed atomicity. * get_property() can be called in a reentrant fashion from either several concurrent sysfs accesses, or a sysfs access concurrently with an access from power_supply_core.c, which in turn are triggered from a work queue in the driver itself. * This fixes bogus readings affecting the capacity and the charge_now values - possibly others as well. ** Patch added: "0001-power-bq27541-driver-serialize-get_property.patch" https://bugs.launchpad.net/ubuntu-nexus7/+bug/1093543/+attachment/3505724/+files/0001-power-bq27541-driver-serialize-get_property.patch -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to upower in Ubuntu. https://bugs.launchpad.net/bugs/1093543 Title: Battery status behaves erratically Status in Ubuntu on the Nexus 7: Confirmed Status in “upower” package in Ubuntu: Confirmed Bug description: I've recently updated my nexus and I've noticed that the battery system behaves very erratically. It will say that the battery is at 43%, 1 hour left, then say it is low with 43% and 1 minute left. At some points it says the battery is critical and shuts down the screen, only to re-awake soon after saying that the battery is simply low. The percentage seems to remain constant, however the time left changes. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1093543/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp

