From f71f8c33575d7229763a73ec6c20669b5954081c Mon Sep 17 00:00:00 2001 From: Gurumurthy Gowdar Date: Tue, 29 May 2012 16:49:06 +0530 Subject: [PATCH] MFLD/Battery: fixes the phone freezing issue when process of shutdown. BZ: 35620 The patch fixes the phone freezing issue when the process of shutdown. Change-Id: Icce3280405a43e31497482b1788d906157864985 Signed-off-by: Gurumurthy Gowdar Reviewed-on: http://android.intel.com:8080/50515 Reviewed-by: Tc, Jenny Reviewed-by: Jena, TapanX Tested-by: Kallappa Manjanna, MadhukumarX Reviewed-by: buildbot Tested-by: buildbot --- drivers/power/intel_mdf_battery.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/power/intel_mdf_battery.c b/drivers/power/intel_mdf_battery.c index d70a2f6..5b8033a 100644 --- a/drivers/power/intel_mdf_battery.c +++ b/drivers/power/intel_mdf_battery.c @@ -866,7 +866,11 @@ static int msic_usb_get_property(struct power_supply *psy, err_event = mbi->msic_chr_err; mutex_unlock(&mbi->event_lock); - mutex_lock(&mbi->usb_chrg_lock); + if (system_state != SYSTEM_RUNNING) { + if (!mutex_trylock(&mbi->usb_chrg_lock)) + return -EBUSY; + } else + mutex_lock(&mbi->usb_chrg_lock); switch (psp) { case POWER_SUPPLY_PROP_PRESENT: -- 2.7.4