Patch "ACPI: battery: Accept charges over the design capacity as full" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ACPI: battery: Accept charges over the design capacity as full

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-battery-accept-charges-over-the-design-capacity.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d789053ff86fa762028c57af02402fc413c66879
Author: André Almeida <andrealmeid@xxxxxxxxxxxxx>
Date:   Fri Oct 8 00:05:29 2021 -0300

    ACPI: battery: Accept charges over the design capacity as full
    
    [ Upstream commit 2835f327bd1240508db2c89fe94a056faa53c49a ]
    
    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@xxxxxxxxxxxxx>
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Reviewed-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 13e7b56e33aeb..30996effc491b 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -193,7 +193,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 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux