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,
	"Michael Auer" <mick@yoxcu.de>
Subject: [PATCH 0/3] power: supply: bq27xxx: fix wrong battery states after resume
Date: Sat, 21 Nov 2026 21:41:34 +0100	[thread overview]
Message-ID: <20261121204137.848173-1-mick@yoxcu.de> (raw)

On a OnePlus 6 (bq27541 on i2c-qcom-geni) user space sometimes sees a
wrong battery state right after resume.

Patch 1 fixes "Not charging" while on battery, when the current reads 0
after deep sleep. Patches 2 and 3 fix a battery that is reported as
missing at 0 % after a failed read, which made the desktop start its
critical battery action. It happened in about 1 of 350 resumes. Patch 2
covers a single missed transfer, patch 3 a failure that lasts longer.

All three are in daily use on a OnePlus 6 with an sdm845-mainline
7.1-rc1 based kernel, patch 1 since late September, patches 2 and 3
since early October. On power-supply for-next they were only build
tested (W=1, arm64 and x86_64 allmodconfig).

Tool use: the analysis, the code and the commit messages were
written with an LLM coding assistant (Claude Code). I reviewed all
of it and tested it on my phone as described above.

Michael Auer (3):
  power: supply: bq27xxx: report discharging at zero current without a
    charger
  power: supply: bq27xxx: retry a failed register read once
  power: supply: bq27xxx: keep the last values over a short read failure

 drivers/power/supply/bq27xxx_battery.c | 60 ++++++++++++++++++++++++++
 include/linux/power/bq27xxx_battery.h  |  2 +
 2 files changed, 62 insertions(+)


base-commit: abbe0a96bdbadae9e29489a1528fa436c55aca25
-- 
2.43.0


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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 20:41 Michael Auer [this message]
2026-11-21 20:41 ` [PATCH 1/3] power: supply: bq27xxx: report discharging at zero current without a charger Michael Auer
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=20261121204137.848173-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®