Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 872b407f authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

power: qpnp-linear-charger: Fix mutex deadlock in charger



There is a deadlock condition between BMS reporting end-of-charge
and charger driver resuming charging in get capacity.

Fix the above deadlock by calling get capacity outside the
mutex lock.

CRs-Fixed: 675064
Change-Id: I385bfc301bd55d5460d2294a8427d31648df9bb6
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 38be2e8f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -881,7 +881,10 @@ static int get_prop_capacity(struct qpnp_lbc_chip *chip)
		return DEFAULT_CAPACITY;

	if (chip->bms_psy) {
		chip->bms_psy->get_property(chip->bms_psy,
				POWER_SUPPLY_PROP_CAPACITY, &ret);
		mutex_lock(&chip->chg_enable_lock);
		if (chip->chg_done)
			chip->bms_psy->get_property(chip->bms_psy,
					POWER_SUPPLY_PROP_CAPACITY, &ret);
		battery_status = get_prop_batt_status(chip);