]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: battery: fix incorrect charging status when current is zero
authorAta İlhan Köktürk <atailhan2006@gmail.com>
Thu, 29 Jan 2026 14:48:56 +0000 (17:48 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 1 Feb 2026 12:48:23 +0000 (13:48 +0100)
commitbb1256e0ddc7e9e406164319769b9f8d8389f056
tree4a93b223812b67f07c71d821fa3bb48aeefb1ac4
parent0a869409a981112565fac055739e9e2fd8575ade
ACPI: battery: fix incorrect charging status when current is zero

On some laptops, such as the Huawei Matebook series, the embedded
controller continues to report "Charging" status even when the
charge threshold is reached and no current is being drawn.

This incorrect reporting prevents the system from switching to battery
power profiles, leading to significantly higher power (e.g., 18W instead
of 7W during browsing) and missed remaining battery time estimation.

Validate the "Charging" state by checking if rate_now is zero. If the
hardware reports charging but the current is zero, report "Not Charging"
to user space.

Signed-off-by: Ata İlhan Köktürk <atailhan2006@gmail.com>
[ rjw: Whitespace fix, braces added to an inner if (), new comment rewrite ]
[ rjw: Changelog edits ]
Link: https://patch.msgid.link/20260129144856.43058-1-atailhan2006@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c