Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On x20 series ThinkPads, tm_smapi has conflicts with the shipped kernel drivers. #70

Open
tadawson opened this issue Sep 10, 2024 · 0 comments

Comments

@tadawson
Copy link

Testing in 5.15.x as well as 5.17.19, I have been having issues with the tp_smapi devices not always responding correctly.

Specifically the "tlp" package queries status from both the kernel shipped thinkpad drivers, as well as tp_smapi, and either alone is find, but when both are queried at similar points in time, the status device from tp_smapi /sys/devices/platform/smapi/BAT0/state intermittently responds with "none" and the error:

kernel: thinkpad_ec: thinkpad_ec_read_row: failed waiting for data: (0x01:0x00)->0xfffffff0

is thrown.

Note that only the tp_smapi devices are affected - the "equivalent" device at /sys/class/power_supply/BAT0/status is unaffected.

This has been tested on both my W520 on the above mentioned kernel(s), as well as an X220 on an (I believe) 6.x kernel. (Done and verified by linrunner - author of TLP)

The practical upshot of this is that TLP cannot perform a battery recalibration on systems using these devices, since the recal monitoring loop utilized the tp_smapi devices to determine recal state, and the errant return of "none" causes it to abort.

It seems like this may been a timing/locking issue with querying the EC in this case, and either the driver needs to block until it can get a clean read, the timeouts be increased to allow it to do so, or ? ? ?

To duplicate quickly, run two while loops:

while true
do
cat /sys/class/power_supply/BAT0/*
done

and while true
do
cat /sys/devices/platform/smapi/BAT0
done

and also query the status (or really any) device in the tp_smapi tree . . . It will occasionally not return a valid result.

This does not happen if only one driver "family" is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant