Skip to content

Commit bf9d5cb

Browse files
superna9999sre
authored andcommitted
power: supply: qcom_battmgr: return EAGAIN when firmware service is not up
The driver returns -ENODEV when the firmware battmrg service hasn't started yet, while per-se -ENODEV is fine, we usually use -EAGAIN to tell the user to retry again later. And the power supply core uses -EGAIN when the device isn't initialized, let's use the same return. This notably causes an infinite spam of: thermal thermal_zoneXX: failed to read out thermal zone (-19) because the thermal core doesn't understand -ENODEV, but only considers -EAGAIN as a non-fatal error. While it didn't appear until now, commit [1] fixes thermal core and no more ignores thermal zones returning an error at first temperature update. [1] 5725f40 ("thermal: core: Call monitor_thermal_zone() if zone temperature is invalid") Link: https://lore.kernel.org/all/2ed4c630-204a-4f80-a37f-f2ca838eb455@linaro.org/ Cc: stable@vger.kernel.org Fixes: 29e8142 ("power: supply: Introduce Qualcomm PMIC GLINK power supply") Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Tested-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org> Link: https://lore.kernel.org/r/20240715-topic-sm8x50-upstream-fix-battmgr-temp-tz-warn-v1-1-16e842ccead7@linaro.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 81af7f2 commit bf9d5cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/power/supply/qcom_battmgr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int qcom_battmgr_bat_get_property(struct power_supply *psy,
486486
int ret;
487487

488488
if (!battmgr->service_up)
489-
return -ENODEV;
489+
return -EAGAIN;
490490

491491
if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
492492
ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
@@ -683,7 +683,7 @@ static int qcom_battmgr_ac_get_property(struct power_supply *psy,
683683
int ret;
684684

685685
if (!battmgr->service_up)
686-
return -ENODEV;
686+
return -EAGAIN;
687687

688688
ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
689689
if (ret)
@@ -748,7 +748,7 @@ static int qcom_battmgr_usb_get_property(struct power_supply *psy,
748748
int ret;
749749

750750
if (!battmgr->service_up)
751-
return -ENODEV;
751+
return -EAGAIN;
752752

753753
if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
754754
ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
@@ -867,7 +867,7 @@ static int qcom_battmgr_wls_get_property(struct power_supply *psy,
867867
int ret;
868868

869869
if (!battmgr->service_up)
870-
return -ENODEV;
870+
return -EAGAIN;
871871

872872
if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
873873
ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);

0 commit comments

Comments
 (0)