[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h0BonJCrOm7PnK66JpnbLgsBTmL-RefGPhi=6mZC--gQ@mail.gmail.com>
Date: Wed, 13 Oct 2021 19:54:52 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sebastian Reichel <sebastian.reichel@...labora.com>,
André Almeida <andrealmeid@...labora.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Collabora Kernel ML <kernel@...labora.com>,
krisman@...labora.com,
"Pierre-Loup A . Griffais" <pgriffais@...vesoftware.com>,
Hans de Goede <hdegoede@...hat.com>
Subject: Re: [PATCH 1/1] acpi: battery: Accept charges over the design
capacity as full
On Wed, Oct 13, 2021 at 1:34 PM Sebastian Reichel
<sebastian.reichel@...labora.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@...labora.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@...labora.com>
Applied as 5.16 material, thanks!
Powered by blists - more mailing lists