Bug 200333 - Incorrect battery id for BAT1 on Thinkpad 13
Summary: Incorrect battery id for BAT1 on Thinkpad 13
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform_x86 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_platform_x86@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-28 19:08 UTC by j.witteveen
Modified: 2022-06-20 16:27 UTC (History)
0 users

See Also:
Kernel Version: 4.17
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description j.witteveen 2018-06-28 19:08:29 UTC
On a Thinkpad 13

    $ cat /sys/class/dmi/id/product_version 
    ThinkPad S2

the battery name is BAT1, but its id for ACPI calls is 1. The battery management code introduced in 4.17 contains a tpacpi_battery_get_id function that returns 2 (BAT_SECONDARY) when invoked for "BAT1". This prevents the code from working for this line of laptops. Would the code return 1 (BAT_PRIMARY) for these machines, then the battery management functions correctly.

I suspect that this also might be the case for machines that identify as "ThinkPad 13 2nd Gen" but cannot test this due to not owning such a laptop.
Comment 1 j.witteveen 2018-06-28 19:12:03 UTC
In order to run with an unsupported battery (i.e. a Thinkpad 13 on kernel 4.17), https://patchwork.kernel.org/patch/10483501/ is needed. Otherwise, the kernel freezes.
Comment 2 j.witteveen 2018-07-12 13:57:35 UTC
Patch: https://patchwork.kernel.org/patch/10519235/

Note You need to log in before you can comment on or make changes to this bug.