lkml.org 
[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI: full battery charge cannot exceed current one
On Sat, Dec 07, 2013 at 01:36:41PM +0100, Jan Vcelak wrote:
> Some degraded batteries report maximal capacity to be smaller than
> current charge of the battery. This can confuse some user space
> applications (like upower).

Can't we just fix upower?

> +
> + /* Some degraded batteries report lower full charge than current one. */
> + if (battery->capacity_now > battery->full_charge_capacity)
> + battery->full_charge_capacity = battery->capacity_now;
> +

Does upower read *_full on every read of the value? How do we guarantee
that it won't read energy_now without updating energy_full and still
come up with an incorrect calculation?

--
Matthew Garrett | mjg59@srcf.ucam.org


\
 
 \ /
  Last update: 2013-12-09 18:21    [W:1.744 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site