From 208e1c5457315ca5e21ba27fb9d3b429c7edf94b Mon Sep 17 00:00:00 2001 From: Anirudh Ghayal Date: Thu, 14 May 2020 21:33:33 +0530 Subject: [PATCH] power: smb5-lib: Use the unlocked version votable for FV Float voltage is read in the batt_health() callback. batt_health() is called from batt_status() and batt_status() is also called from the FV callback leading to a deadlock. Fix it by using the unlocked version of votable while reading FV. Change-Id: Ie6f9f683c048a2a1c64d46716433bcff359dc3b0 Signed-off-by: Anirudh Ghayal --- drivers/power/supply/qcom/smb5-lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/qcom/smb5-lib.c b/drivers/power/supply/qcom/smb5-lib.c index 8dc118fe9cb3..a96742c4c76b 100644 --- a/drivers/power/supply/qcom/smb5-lib.c +++ b/drivers/power/supply/qcom/smb5-lib.c @@ -2262,7 +2262,8 @@ int smblib_get_prop_batt_health(struct smb_charger *chg, * If Vbatt is within 40mV above Vfloat, then don't * treat it as overvoltage. */ - effective_fv_uv = get_effective_result(chg->fv_votable); + effective_fv_uv = get_effective_result_locked( + chg->fv_votable); if (pval.intval >= effective_fv_uv + 40000) { val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; smblib_err(chg, "battery over-voltage vbat_fg = %duV, fv = %duV\n",