mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Auer <mick@yoxcu.de>
To: Sebastian Reichel <sre@kernel.org>
Cc: "Pali Rohár" <pali@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] power: supply: bq27xxx: report discharging at zero current without a charger
Date: Sat, 21 Nov 2026 22:33:39 +0100	[thread overview]
Message-ID: <20261121213341.865904-1-mick@yoxcu.de> (raw)
In-Reply-To: <20261121204137.848173-2-mick@yoxcu.de>

Hi,

A sashiko review of this series (not mailed to the list) found a
problem in this patch that I can confirm:
power_supply_is_system_supplied() also counts this battery, so on a
board whose charger is not registered in Linux it returns 0. A full
battery on such a charger at zero current would then report
Discharging instead of Not charging, the case that commit c3a6d6a1dfc8
("power: supply: bq27xxx: make status more robust") fixed.

For v2 I plan to use power_supply_am_i_supplied(di->bat) instead. It
returns -ENODEV when no supplier is linked, so those boards keep Not
charging, and it does not read this battery, so the check can also run
in the cached update. On the OnePlus 6 this needs the gauge linked to
the charger in the DT (power-supplies), which I would send as a
separate patch.

Patch 3/3 needs a fix too: its status fallback returns the status of
the cached update, which has the same zero current problem, and which
is never set on BQ27XXX_O_ZERO gauges.

If you prefer another way, please tell me before v2.

Michael

  reply	other threads:[~2026-11-21 21:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 20:41 [PATCH 0/3] power: supply: bq27xxx: fix wrong battery states after resume Michael Auer
2026-11-21 20:41 ` [PATCH 1/3] power: supply: bq27xxx: report discharging at zero current without a charger Michael Auer
2026-11-21 21:33   ` Michael Auer [this message]
2026-11-21 20:41 ` [PATCH 2/3] power: supply: bq27xxx: retry a failed register read once Michael Auer
2026-11-21 20:41 ` [PATCH 3/3] power: supply: bq27xxx: keep the last values over a short read failure Michael Auer

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=20261121213341.865904-1-mick@yoxcu.de \
    --to=mick@yoxcu.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali@kernel.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®