mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>,
	 Bjorn Andersson <andersson@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	 linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power: supply: qcom_battmgr: report full batteries
Date: Sun, 18 Oct 2026 01:23:12 +0200	[thread overview]
Message-ID: <atQCEUI62OYTDUcO@venus> (raw)
In-Reply-To: <32681ae8-3356-4570-8631-650fcd88c803@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 2078 bytes --]

Hi,

On Tue, Oct 13, 2026 at 01:21:53PM +0200, Konrad Dybcio wrote:
> On 10/8/26 11:14 AM, Bjorn Andersson wrote:
> > The SC8280XP battery-status response has no explicit full state. When a
> > battery reaches its full capacity on external power, neither the charging
> > nor discharging bit is set. The driver consequently reports "Not
> > charging", which can make userspace show the system as battery powered.
> > 
> > Use the response's power-online bit and the reported capacity to identify
> > a battery that is full while externally powered. Preserve "Not charging"
> > for a battery whose charging is inhibited below its full capacity.
> 
> Let's define that bit, as it's not obvious what it corresponds to.
> 
> > 
> > Fixes: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
> > Assisted-by: LLM
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> > ---
> >  drivers/power/supply/qcom_battmgr.c | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
> > index 7716eb9e1aff..97cbe966ea84 100644
> > --- a/drivers/power/supply/qcom_battmgr.c
> > +++ b/drivers/power/supply/qcom_battmgr.c
> > @@ -1261,6 +1261,7 @@ static void qcom_battmgr_sc8280xp_callback(struct qcom_battmgr *battmgr,
> >  	unsigned int opcode = le32_to_cpu(resp->hdr.opcode);
> >  	unsigned int source;
> >  	unsigned int state;
> > +	unsigned int power_state;
> 
> Reverse-Christmas-tree, please

I fixed this while applying.

> Claude also has concerns regarding how this interacts with charge
> limit (although perhaps "not charging" should be good there?)

Not Charging generally means the system is powered externally and
the battery is neither charged not discharged. The Full state is
effectively a substate of Not Charging. So the main issue from Bjorn
is a userspace bug.

> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> Konrad

Greetings,

-- Sebastian



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-10-17 23:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  9:14 Bjorn Andersson
2026-10-13 11:21 ` Konrad Dybcio
2026-10-17 23:23   ` Sebastian Reichel [this message]
2026-10-17 23:17 ` 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=atQCEUI62OYTDUcO@venus \
    --to=sebastian.reichel@collabora.com \
    --cc=andersson@kernel.org \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=neil.armstrong@linaro.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®