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]
Message-ID: <948711a6-385d-799c-b71f-037d7fa0f478@gmx.net>
Date:   Sat, 4 Dec 2021 17:04:23 +0100
From:   Thomas Koch <linrunner@....net>
To:     Thomas Weißschuh <linux@...ssschuh.net>,
        linux-pm@...r.kernel.org, Sebastian Reichel <sre@...nel.org>,
        ibm-acpi-devel@...ts.sourceforge.net,
        platform-driver-x86@...r.kernel.org,
        Mark Gross <markgross@...nel.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Henrique de Moraes Holschuh <hmh@....eng.br>
Cc:     linux-kernel@...r.kernel.org, bberg@...hat.com, hadess@...ess.net,
        markpearson@...ovo.com, nicolopiazzalunga@...il.com,
        njoshi1@...ovo.com, smclt30p@...il.com
Subject: Re: [PATCH 0/4] power: supply: add charge_behaviour property
 (force-discharge, inhibit-charge)

Hi Thomas,

On 24.11.21 00:27, Thomas Weißschuh wrote:
> Hi,
>
> this series adds support for the charge_behaviour property to the power
> subsystem and thinkpad_acpi driver.
>
> As thinkpad_acpi has to use the 'struct power_supply' created by the generic
> ACPI driver it has to rely on custom sysfs attributes instead of proper
> power_supply properties to implement this property.
>
> Patch 1: Adds the power_supply documentation and basic public API
> Patch 2: Adds helpers to power_supply core to help drivers implement the
>    charge_behaviour attribute
> Patch 3: Adds support for force-discharge to thinkpad_acpi.
> Patch 4: Adds support for inhibit-discharge to thinkpad_acpi.
>
> Patch 3 and 4 are largely taken from other patches and adapted to the new API.
> (Links are in the patch trailer)
>
> Ognjen Galic:
>
> Your S-o-b is on the original inhibit_charge and force_discharge patches.
> I would like to add you as Co-developed-by but to do that it will also require
> your S-o-b. Could you give your sign-offs for the new patches, so you can be
> properly attributed?
>
> Sebastian Reichel:
>
> Currently the series does not actually support the property as a proper
> powersupply property handled fully by power_supply_sysfs.c because there would
> be no user for this property.
>
> Previous discussions about the API:
>
> https://lore.kernel.org/platform-driver-x86/20211108192852.357473-1-linux@weissschuh.net/
> https://lore.kernel.org/platform-driver-x86/21569a89-8303-8573-05fb-c2fec29983d1@gmail.com/
>
> v1: https://lore.kernel.org/lkml/20211113104225.141333-1-linux@weissschuh.net/
> v1 -> v2:
>
> * Use sysfs_emit-APIs instead of plain sprintf
> * More cecks for actual feature availability
> * Validation of the written values
> * Read inhibit-charge via BICG instead of PSSG (peak shift state)
> * Don't mangle error numbers in charge_behaviour_store()
>
> Open points:
>
> Thomas Koch has observed that on a T450s with two batteries
> inhibit-charge on BAT0 will affect both batteries and for BAT1 it is ignored
> entirely, this seems to be a bug in the EC.
> On my T460s with two batteries it works correctly.
>
> Thomas Weißschuh (4):
>    power: supply: add charge_behaviour attributes
>    power: supply: add helpers for charge_behaviour sysfs
>    platform/x86: thinkpad_acpi: support force-discharge
>    platform/x86: thinkpad_acpi: support inhibit-charge
>
>   Documentation/ABI/testing/sysfs-class-power |  14 ++
>   drivers/platform/x86/thinkpad_acpi.c        | 191 +++++++++++++++++++-
>   drivers/power/supply/power_supply_sysfs.c   |  51 ++++++
>   include/linux/power_supply.h                |  16 ++
>   4 files changed, 268 insertions(+), 4 deletions(-)
>
>
> base-commit: 66f4beaa6c1d28161f534471484b2daa2de1dce0
>

Reviewed-by
: Thomas Koch <linrunner@....net>
Tested-by: Thomas Koch <linrunner@....net>

Works well on ThinkPad X220, T450s, X1C6 with the exception mentioned above.

The new API is included in TLP already [1].

[1]
https://github.com/linrunner/TLP/commit/f0bf18f847470ae495a68f9f0e30130b96348936


--
Freundliche Grüße / Kind regards,
Thomas Koch

Mail : linrunner@....net
Web  : https://linrunner.de/tlp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ