From: Todd Poynor Date: Wed, 13 Feb 2013 04:47:48 +0000 (-0800) Subject: power: android-battery: push uevent whenever charge source changes X-Git-Tag: firefly_0821_release~4090^2~601 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d54003046ef0435fc1e85329ea5a34da22b8ab3;p=firefly-linux-kernel-4.4.55.git power: android-battery: push uevent whenever charge source changes Ensure userspace reads an up-to-date value for charging status whenever the charge source is updated. Avoid races where stale charging state may be reflected in userspace until the next battery state poll. Change-Id: Ia744db48584e9e9abf442710c279af9e3a25c079 Signed-off-by: Todd Poynor --- diff --git a/drivers/power/android_battery.c b/drivers/power/android_battery.c index 6e8b4054c8d7..8d45ff0f3677 100644 --- a/drivers/power/android_battery.c +++ b/drivers/power/android_battery.c @@ -399,6 +399,7 @@ static void android_bat_charger_work(struct work_struct *work) mutex_unlock(&android_bat_state_lock); wake_lock_timeout(&battery->charger_wake_lock, HZ * 2); + power_supply_changed(&battery->psy_bat); }