[SRU] [C] [PATCH 0/1] Fix battery charge threshold writing on Thinkpads

Kai-Heng Feng kai.heng.feng at canonical.com
Wed Feb 27 14:23:16 UTC 2019


The original bug reporter already filled in the SRU form, so I'll just
use them here:

[Problem description]
Kernel 4.17 introduced a new interface to set charge thresholds: The
interface remained unchanged with 4.18. There's a bug preventing writing
the charge thresholds for the secondary battery (BAT1).

[Impact]
ThinkPads with two batteries (ThinkPad "power bridge") e.g.
X240, T440(s), X250, T450(s), X260, T460(s), X270, T470(s) et al.

[Steps to reproduce]
echo 42 > /sys/class/power_supply/BAT1/charge_start_threshold
    bash: echo: write error: No such device

echo 42 > /sys/class/power_supply/BAT0/charge_start_threshold
-- primary battery works!

[Fix]
Problem was fixed in 4.19:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?h=v4.19.15&id=d22296d9c38fd29a96bb5079fb8d17cee278f40e

I propose to cherry-pick the patch for 4.18.

[Test Case]
See above, a patched 4.18 works for T450s.

[Regression Potential]
Low. This patch only applies to several ThinkPad machines, and after applying
this patch, charge_start/stop_threshold work for BAT0 and BAT.

Thomas Weißschuh (1):
  platform/x86: thinkpad_acpi: Fix multi-battery bug

 drivers/platform/x86/thinkpad_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.17.1




More information about the kernel-team mailing list