From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Johan Hovold <johan@kernel.org>, Abel Vesa <abel.vesa@linaro.org>
Subject: Re: [PATCH] power: supply: qcom_battmgr: return EAGAIN when firmware service is not up
Date: Tue, 16 Jul 2024 14:42:44 +0200 [thread overview]
Message-ID: <ZpZqxEof85jo-1K3@linaro.org> (raw)
In-Reply-To: <20240715-topic-sm8x50-upstream-fix-battmgr-temp-tz-warn-v1-1-16e842ccead7@linaro.org>
On Mon, Jul 15, 2024 at 02:57:06PM +0200, Neil Armstrong wrote:
> 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] 5725f40698b9 ("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: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
The "failed to read out thermal zone (-19)" error happens on 6.10 on the
Qualcomm X1E80100 CRD too. This patch fixes it. Thanks for looking into
this! FWIW:
Tested-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
> drivers/power/supply/qcom_battmgr.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
> index 46f36dcb185c..bde874b5e0e7 100644
> --- a/drivers/power/supply/qcom_battmgr.c
> +++ b/drivers/power/supply/qcom_battmgr.c
> @@ -486,7 +486,7 @@ static int qcom_battmgr_bat_get_property(struct power_supply *psy,
> int ret;
>
> if (!battmgr->service_up)
> - return -ENODEV;
> + return -EAGAIN;
>
> if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
> ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
> @@ -683,7 +683,7 @@ static int qcom_battmgr_ac_get_property(struct power_supply *psy,
> int ret;
>
> if (!battmgr->service_up)
> - return -ENODEV;
> + return -EAGAIN;
>
> ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
> if (ret)
> @@ -748,7 +748,7 @@ static int qcom_battmgr_usb_get_property(struct power_supply *psy,
> int ret;
>
> if (!battmgr->service_up)
> - return -ENODEV;
> + return -EAGAIN;
>
> if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
> ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
> @@ -867,7 +867,7 @@ static int qcom_battmgr_wls_get_property(struct power_supply *psy,
> int ret;
>
> if (!battmgr->service_up)
> - return -ENODEV;
> + return -EAGAIN;
>
> if (battmgr->variant == QCOM_BATTMGR_SC8280XP)
> ret = qcom_battmgr_bat_sc8280xp_update(battmgr, psp);
>
> ---
> base-commit: 91e3b24eb7d297d9d99030800ed96944b8652eaf
> change-id: 20240715-topic-sm8x50-upstream-fix-battmgr-temp-tz-warn-c5a2f956d28d
>
> Best regards,
> --
> Neil Armstrong <neil.armstrong@linaro.org>
>
next prev parent reply other threads:[~2024-07-16 12:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 12:57 [PATCH] power: supply: qcom_battmgr: return EAGAIN when firmware service is not up Neil Armstrong
2024-07-16 12:42 ` Stephan Gerhold [this message]
2024-07-26 22:39 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZpZqxEof85jo-1K3@linaro.org \
--to=stephan.gerhold@linaro.org \
--cc=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=johan@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rjw@rjwysocki.net \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox