[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <754b4466-4636-4a51-980a-5e5c21953f44@t-8ch.de>
Date: Tue, 16 Nov 2021 13:18:09 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Hans de Goede <hdegoede@...hat.com>
Cc: 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>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
linux-kernel@...r.kernel.org, linrunner@....net, bberg@...hat.com,
hadess@...ess.net, markpearson@...ovo.com,
nicolopiazzalunga@...il.com, njoshi1@...ovo.com, smclt30p@...il.com
Subject: Re: [PATCH 4/4] platform/x86: thinkpad_acpi: support inhibit-charge
Hi Hans,
On 2021-11-16 11:58+0100, Hans de Goede wrote:
> Thank you for working on this!
Thanks for the review!
> On 11/13/21 11:42, Thomas Weißschuh wrote:
> > @@ -9673,6 +9711,11 @@ static ssize_t charge_behaviour_show(struct device *dev,
> > return -ENODEV;
> > if (ret)
> > active = POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE;
> > + } else if (available & BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE)) {
>
> The use of else-if here seems wrong, this suggests that batterys can never
> support both force-discharge and inhibit-charge behavior, which they can, so this
> means that active can now never get set to BEHAVIOUR_INHIBIT_CHARGE on
> batteries which support both.
>
> So AFAICT the else part of the else if should be dropped here, making this
> a new stand alone if block.
Indeed, I'll fix this logic for v2.
Thanks,
Thomas
Powered by blists - more mailing lists