All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-pm@vger.kernel.org, Sebastian Reichel <sre@kernel.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org,
	Mark Gross <markgross@kernel.org>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	linux-kernel@vger.kernel.org, linrunner@gmx.net,
	bberg@redhat.com, hadess@hadess.net, markpearson@lenovo.com,
	nicolopiazzalunga@gmail.com, njoshi1@lenovo.com,
	smclt30p@gmail.com
Subject: Re: [PATCH 4/4] platform/x86: thinkpad_acpi: support inhibit-charge
Date: Tue, 16 Nov 2021 13:18:09 +0100	[thread overview]
Message-ID: <754b4466-4636-4a51-980a-5e5c21953f44@t-8ch.de> (raw)
In-Reply-To: <09a66da1-1a8b-a668-3179-81670303ea37@redhat.com>

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

  reply	other threads:[~2021-11-16 12:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 10:42 [PATCH 0/4] power: supply: add charge_behaviour property (force-discharge, inhibit-charge) Thomas Weißschuh
2021-11-13 10:42 ` [PATCH 1/4] power: supply: add charge_behaviour attributes Thomas Weißschuh
2021-11-13 10:42 ` [PATCH 2/4] power: supply: add helpers for charge_behaviour sysfs Thomas Weißschuh
2021-11-13 10:42 ` [PATCH 3/4] platform/x86: thinkpad_acpi: support force-discharge Thomas Weißschuh
2021-11-16 20:35   ` [External] " Mark Pearson
2021-11-13 10:42 ` [PATCH 4/4] platform/x86: thinkpad_acpi: support inhibit-charge Thomas Weißschuh
2021-11-16 10:58   ` Hans de Goede
2021-11-16 12:18     ` Thomas Weißschuh [this message]
2021-11-16 20:52   ` [External] " Mark Pearson
2021-11-16 23:44     ` Thomas Weißschuh
2021-11-17 15:09       ` Mark Pearson
2021-11-16 16:56 ` [PATCH 0/4] power: supply: add charge_behaviour property (force-discharge, inhibit-charge) Thomas Koch
2021-11-17 17:57   ` Thomas Weißschuh
2021-11-17 18:20     ` [External] " Mark Pearson
2021-11-17 18:36     ` Thomas Koch

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=754b4466-4636-4a51-980a-5e5c21953f44@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=bberg@redhat.com \
    --cc=hadess@hadess.net \
    --cc=hdegoede@redhat.com \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=linrunner@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=markpearson@lenovo.com \
    --cc=nicolopiazzalunga@gmail.com \
    --cc=njoshi1@lenovo.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=smclt30p@gmail.com \
    --cc=sre@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.