lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <mub3b5r3zpcgsisicjbbl2kudefibj7t2n3jz5pgshlqsglnlw@5a7gc3trlnn5>
Date: Fri, 19 Sep 2025 01:17:55 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Fenglin Wu <fenglin.wu@....qualcomm.com>
Cc: Konrad Dybcio <konrad.dybcio@....qualcomm.com>, 
	Bjorn Andersson <andersson@...nel.org>, Konrad Dybcio <konradybcio@...nel.org>, 
	Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
	Conor Dooley <conor+dt@...nel.org>, Heikki Krogerus <heikki.krogerus@...ux.intel.com>, 
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>, 
	Bryan O'Donoghue <bryan.odonoghue@...aro.org>, 
	Subbaraman Narayanamurthy <subbaraman.narayanamurthy@....qualcomm.com>, David Collins <david.collins@....qualcomm.com>, 
	György Kurucz <me@...uczgy.com>, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-msm@...r.kernel.org, kernel@....qualcomm.com, devicetree@...r.kernel.org, 
	linux-usb@...r.kernel.org
Subject: Re: [PATCH v5 9/9] power: supply: qcom_battmgr: handle charging
 state change notifications

Hi,

On Thu, Sep 18, 2025 at 10:01:24AM +0800, Fenglin Wu wrote:
> On 9/17/2025 7:14 PM, Konrad Dybcio wrote:
> > On 9/17/25 12:15 PM, Fenglin Wu via B4 Relay wrote:
> > > From: Fenglin Wu <fenglin.wu@....qualcomm.com>
> > > 
> > > The X1E80100 battery management firmware sends a notification with
> > > code 0x83 when the battery charging state changes, such as switching
> > > between fast charge, taper charge, end of charge, or any other error
> > > charging states. The same notification code is used with bit[16] set
> > > if charging stops due to reaching the charge control end threshold.
> > > Additionally, a 2-bit value is added in bit[18:17] with the same code
> > > and used to indicate the charging source capability: a value of 2
> > > represents a strong charger, 1 is a weak charger, and 0 is no charging
> > > source. The 3-MSB [18:16] in the notification code is not much useful
> > > for now, hence just ignore them and trigger a power supply change event
> > > whenever 0x83 notification code is received. This helps to eliminate the
> > > unknown notification error messages.
> > Thank you for explaining the technical background.
> > 
> > Please hit enter somewhere in your commit message, this is a very
> > long paragraph, making it difficult to read.
> I just realized I made a mistake on the bit position, it should be bit[8]
> for reaching to the charge control threshold, bit[10:9] for charging source
> capability. I don't know what I was thinking when writing the commit text
> :(. I will correct them in the next patch.
> > 
> > I believe this maps to:
> > 
> > 0 -> POWER_SUPPLY_CHARGE_TYPE_NONE
> > 1 -> POWER_SUPPLY_CHARGE_TYPE_TRICKLE
> > 2 -> POWER_SUPPLY_CHARGE_TYPE_FAST (or _STANDARD, I see battmgr code
> > reports them both as 2)
> > 
> > However, we already set it to none/trickle/standard(taper) based on
> > the usual notifications, so I'm not sure if these are more common or
> > arrive outside the normal state changes - if so, perhaps we can take
> > them into account as well?
> 
> This is not related with the real charging status. I double checked in the
> battery management firmware, it is checking the charging source power
> capability by multiplying maximum voltage and current reading from the PDOs.
> Any charger adapter with a maximum power below 60W is identified as a
> slow/weak charger.

Please include that info in the commit message when sending a v6.
The code change itself LGTM.

Thanks,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ