diff options
author | Bjørn Mork <bjorn@mork.no> | 2014-09-09 04:45:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-09 10:19:03 -0400 |
commit | 583ee394ac503ff9eac0f50673cd569643bdb3b4 (patch) | |
tree | da797d7a3f811846eeaf1b18dc064224f8d66766 /drivers/acpi | |
parent | 2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff) |
Revert "ACPI / battery: Fix warning message in acpi_battery_get_state()"
This reverts commit d719870b41e0 ("ACPI / battery: Fix warning message in
acpi_battery_get_state()")
Capping 'capacity_now' to 'full_charge_capacity' is plain wrong. If this
is necessary to work around some buggy firmware, then the workaround needs
protection against being applied to working firmwares.
Good battery firmwares will allow 'capacity_now' to increase above
'full_charge_capacity', and will update the latter when the battery
is fully charged. By capping 'capacity_now' we lose accurate capacity
reporting until charging is complete whenever 'full_charge_capacity'
needs to be increased.
Fixes: d719870b41e0 ("ACPI / battery: Fix warning message in acpi_battery_get_state()")
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1c162e7be045..48bcf38a0ea8 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -540,12 +540,12 @@ static int acpi_battery_get_state(struct acpi_battery *battery) | |||
540 | */ | 540 | */ |
541 | if (battery->capacity_now > battery->full_charge_capacity | 541 | if (battery->capacity_now > battery->full_charge_capacity |
542 | && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) { | 542 | && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) { |
543 | battery->capacity_now = battery->full_charge_capacity; | ||
543 | if (battery->capacity_now != battery->design_capacity) | 544 | if (battery->capacity_now != battery->design_capacity) |
544 | printk_once(KERN_WARNING FW_BUG | 545 | printk_once(KERN_WARNING FW_BUG |
545 | "battery: reported current charge level (%d) " | 546 | "battery: reported current charge level (%d) " |
546 | "is higher than reported maximum charge level (%d).\n", | 547 | "is higher than reported maximum charge level (%d).\n", |
547 | battery->capacity_now, battery->full_charge_capacity); | 548 | battery->capacity_now, battery->full_charge_capacity); |
548 | battery->capacity_now = battery->full_charge_capacity; | ||
549 | } | 549 | } |
550 | 550 | ||
551 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) | 551 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) |