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] [thread-next>] [day] [month] [year] [list]
Date: Mon, 5 Feb 2024 12:21:45 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Hans de Goede <hdegoede@...hat.com>
Cc: Sebastian Reichel <sre@...nel.org>, 
	Konrad Dybcio <konradybcio@...nel.org>, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Sebastian Reichel <sebastian.reichel@...labora.com>
Subject: Re: [PATCH 3/4] power: supply: mm8013: implement
 POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE

On 2024-02-05 11:00:01+0100, Hans de Goede wrote:
> Hi,
> 
> On 2/4/24 18:26, Thomas Weißschuh wrote:
> > The sysfs is documented to report both the current and all available
> > behaviours. For this POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE needs
> > to be implemented.
> > 
> > Note that this changes the format of the sysfs file
> > (to the documented format):
> > 
> > Before: "auto"
> > After:  "[auto] inhibit-charge"
> > 
> > Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> 
> Changing userspace API like this is never ideal, but given how
> new the mm8013 driver is and that this brings things inline
> with the docs I think that this should be fine:

I agree that it's unfortunate.

However looking at the datasheet [0] it seems to me the driver is
not correctly using the API.

Page 23 documents the flag CHG_INH as follows:

  CHG_INH : Charge Inhibit      When the current is more than or equal to charge
                                threshold current,
                                charge inhibit temperature (upper/lower limit) :1
                                charge permission temperature or the current is
                                less than charge threshold current :0

This is only diagnostic information and not a control-knob, which the API
was meant for.
So POWER_SUPPLY_STATUS_NOT_CHARGING seems like the better match.

> [..]

Thomas


[0] https://product.minebeamitsumi.com/en/product/category/ics/battery/fuel_gauge/parts/download/__icsFiles/afieldfile/2023/07/12/1_download_01_12.pdf

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ