lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0e1b4ad-92a3-5453-5110-bb0c35e13d35@redhat.com>
Date:   Fri, 8 Oct 2021 08:58:04 +0200
From:   Hans de Goede <hdegoede@...hat.com>
To:     André Almeida <andrealmeid@...labora.com>,
        rjw@...ysocki.net, lenb@...nel.org, linux-acpi@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, kernel@...labora.com,
        krisman@...labora.com, sebastian.reichel@...labora.com,
        pgriffais@...vesoftware.com
Subject: Re: [PATCH 1/1] acpi: battery: Accept charges over the design
 capacity as full

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@...labora.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@...hat.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 */
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ