linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"André Almeida" <andrealmeid@collabora.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Collabora Kernel ML <kernel@collabora.com>,
	krisman@collabora.com,
	"Pierre-Loup A . Griffais" <pgriffais@valvesoftware.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH 1/1] acpi: battery: Accept charges over the design capacity as full
Date: Wed, 13 Oct 2021 19:54:52 +0200	[thread overview]
Message-ID: <CAJZ5v0h0BonJCrOm7PnK66JpnbLgsBTmL-RefGPhi=6mZC--gQ@mail.gmail.com> (raw)
In-Reply-To: <20211013113359.redeyos4bc4p5pen@earth.universe>

On Wed, Oct 13, 2021 at 1:34 PM Sebastian Reichel
<sebastian.reichel@collabora.com> wrote:
>
> Hi,
>
> On Fri, Oct 08, 2021 at 12:05:29AM -0300, André Almeida wrote:
> > Some buggy firmware and/or brand new batteries can support a charge that's
> > slightly over the reported design capacity. In such cases, the kernel will
> > report to userspace that the charging state of the battery is "Unknown",
> > when in reality the battery charge is "Full", at least from the design
> > capacity point of view. Make the fallback condition accepts capacities
> > over the designed capacity so userspace knows that is full.
> >
> > Signed-off-by: André Almeida <andrealmeid@collabora.com>
> > ---
> >  drivers/acpi/battery.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> > index dae91f906cea..8afa85d6eb6a 100644
> > --- a/drivers/acpi/battery.c
> > +++ b/drivers/acpi/battery.c
> > @@ -169,7 +169,7 @@ static int acpi_battery_is_charged(struct acpi_battery *battery)
> >               return 1;
> >
> >       /* fallback to using design values for broken batteries */
> > -     if (battery->design_capacity == battery->capacity_now)
> > +     if (battery->design_capacity <= battery->capacity_now)
> >               return 1;
> >
> >       /* we don't do any sort of metric based on percentages */
>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Applied as 5.16 material, thanks!

      reply	other threads:[~2021-10-13 17:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  3:05 [PATCH 0/1] acpi: battery: Accept charges over the design capacity as full André Almeida
2021-10-08  3:05 ` [PATCH 1/1] " André Almeida
2021-10-08  6:58   ` Hans de Goede
2021-10-13 11:33   ` Sebastian Reichel
2021-10-13 17:54     ` Rafael J. Wysocki [this message]

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='CAJZ5v0h0BonJCrOm7PnK66JpnbLgsBTmL-RefGPhi=6mZC--gQ@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=andrealmeid@collabora.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pgriffais@valvesoftware.com \
    --cc=rjw@rjwysocki.net \
    --cc=sebastian.reichel@collabora.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).