From: Hans de Goede <hdegoede@redhat.com>
To: "André Almeida" <andrealmeid@collabora.com>,
rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@collabora.com,
krisman@collabora.com, sebastian.reichel@collabora.com,
pgriffais@valvesoftware.com
Subject: Re: [PATCH 1/1] acpi: battery: Accept charges over the design capacity as full
Date: Fri, 8 Oct 2021 08:58:04 +0200 [thread overview]
Message-ID: <f0e1b4ad-92a3-5453-5110-bb0c35e13d35@redhat.com> (raw)
In-Reply-To: <20211008030529.223682-2-andrealmeid@collabora.com>
Hi,
On 10/8/21 5:05 AM, 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>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> 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 */
>
next prev parent reply other threads:[~2021-10-08 6:58 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 [this message]
2021-10-13 11:33 ` Sebastian Reichel
2021-10-13 17:54 ` Rafael J. Wysocki
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=f0e1b4ad-92a3-5453-5110-bb0c35e13d35@redhat.com \
--to=hdegoede@redhat.com \
--cc=andrealmeid@collabora.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).