From: "Pali Rohár" <pali@kernel.org>
To: "Sicelo A. Mhlongo" <absicsz@gmail.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
linux-pm@vger.kernel.org, sre@kernel.org,
linux-kernel@vger.kernel.org, maemo-leste@lists.dyne.org
Subject: Re: [PATCH] power: supply: bq27xxx_battery: do not update cached flags prematurely
Date: Mon, 25 Nov 2024 18:59:57 +0100 [thread overview]
Message-ID: <20241125175957.rulndmny536pd5c6@pali> (raw)
In-Reply-To: <20241125152945.47937-1-absicsz@gmail.com>
cc Krzysztof, author of the mentioned commit.
On Monday 25 November 2024 17:29:30 Sicelo A. Mhlongo wrote:
> Commit 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about
> status changes") intended to notify userspace when the status changes,
> based on the flags register. However, the cached state is updated too
> early, before the flags are tested for any changes. Remove the premature
> update.
>
> Fixes: 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about status changes")
> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> ---
> drivers/power/supply/bq27xxx_battery.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
> index 40c5ac7a1118..b2c65fe43d5c 100644
> --- a/drivers/power/supply/bq27xxx_battery.c
> +++ b/drivers/power/supply/bq27xxx_battery.c
> @@ -1913,7 +1913,6 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
> cache.flags = -1; /* read error */
> if (cache.flags >= 0) {
> cache.capacity = bq27xxx_battery_read_soc(di);
> - di->cache.flags = cache.flags;
>
> /*
> * On gauges with signed current reporting the current must be
> --
> 2.45.2
>
next prev parent reply other threads:[~2024-11-25 18:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 15:29 Sicelo A. Mhlongo
2024-11-25 17:59 ` Pali Rohár [this message]
2025-01-08 8:35 ` Sicelo
2025-02-21 1:21 ` 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=20241125175957.rulndmny536pd5c6@pali \
--to=pali@kernel.org \
--cc=absicsz@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=maemo-leste@lists.dyne.org \
--cc=sre@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
all inboxes | Powered by JetHome®