You are not logged in.

#1 2018-06-20 11:08:56

dundee
Member
Registered: 2010-09-05
Posts: 16

System freeze after upgrade to 4.17.2

Hi,
my system stopped booting after upgrade to 4.17.2.

It says something about battery extension.

Thinkpad_acpi: error probing battery 2
battery: error in extension, unloading: Thinkpad Battery Extension

I have Lenovo Thinkpad 13.

Any ideas how to fix this?

https://ibb.co/kBhgxy

Thanks

Offline

#2 2018-06-20 12:47:58

majormjr
Member
Registered: 2018-06-20
Posts: 1

Re: System freeze after upgrade to 4.17.2

I was running into the same issue after upgrading to 4.17.2. To fix it I disabled the thinkpad_acpi kernel module.

Boot into the Arch ISO and mount your filesystem. Then create/edit the /etc/modprobe.d/blacklist.conf file and add the line `blacklist thinkpad_acpi`.

After making this change I could boot into the desktop.

Offline

#3 2018-06-20 12:59:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,660

Re: System freeze after upgrade to 4.17.2

The kernel now includes support that used to be provided via acpi_call and tp-smapi itself, do you have either of those installed? This combination seems to result in an error now. Does it work if you remove acpi_call and tp-smapi instead? This might break TLP's battery handling if you use it for now , however support for the native kernel interface is already being added.

If you get that error despite not using these modules, you might have found a real bug.

Last edited by V1del (2018-06-22 07:08:57)

Offline

#4 2018-06-20 13:32:00

dundee
Member
Registered: 2010-09-05
Posts: 16

Re: System freeze after upgrade to 4.17.2

majormjr wrote:

I was running into the same issue after upgrading to 4.17.2. To fix it I disabled the thinkpad_acpi kernel module.

Boot into the Arch ISO and mount your filesystem. Then create/edit the /etc/modprobe.d/blacklist.conf file and add the line `blacklist thinkpad_acpi`.

After making this change I could boot into the desktop.

Blacklisting the thinkpad_acpi solved it for me as well. Many thanks!

Shouldn't this be reported as a bug? I think the thinkpad_acpi module shouldn't be installed at all if it breaks the system (and loads by default).

Last edited by dundee (2018-06-20 13:45:11)

Offline

#5 2018-06-21 05:52:43

dundee
Member
Registered: 2010-09-05
Posts: 16

Re: System freeze after upgrade to 4.17.2

Offline

#6 2018-06-21 22:01:30

loqs
Member
Registered: 2014-03-06
Posts: 17,323

Re: System freeze after upgrade to 4.17.2

@V1del should the packages tp_smapi and acpi_call be removed the repositories if they can not be used with the kernel they are now built for?

Offline

#7 2018-06-22 07:13:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,660

Re: System freeze after upgrade to 4.17.2

@loqs Afaik acpi_call can have other relevant purposes (that's just what it will be used for by TLP), not sure aboout tp-smapi, documentation makes me think that it might have other uses as well.

@On-topic
A few similar threads popped up recently, did any of you explicitly redefine acpi_osi in your kernel params? Remove that line and try to reproduce if that's the case.

Offline

#8 2018-06-22 11:13:51

RX14
Member
Registered: 2015-12-26
Posts: 3

Re: System freeze after upgrade to 4.17.2

Just popping in to say that for me, this bug manifested itself as the system booting perfectly fine, then Xorg hanging on startup (specifically open("/dev/dri/card0", ...)). I initially didn't try this fix because it appeared not to fit the symptoms from this thread, but sure enough blacklisting thinkpad_acpi got X11 to start.

Offline

#9 2018-07-11 11:36:05

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

To my surprise, upstream appears to have picked up the fix faster than Arch.
The fix (see the Arch bug tracker) will be part of 4.17.6.

Hopefully, some future version of the kernel will implement full support for battery management on the Thinkpad 13. I have submitted a patch.

Offline

#10 2018-07-11 14:34:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: System freeze after upgrade to 4.17.2

jouke wrote:

To my surprise, upstream appears to have picked up the fix faster than Arch.

Curious as to why that would be surprising?

https://wiki.archlinux.org/index.php/of … positories


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2018-07-12 10:03:20

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

The patch on the tracker was in time for 4.17.4 and was accepted upstream (often a criterion) in time for 4.17.5. Despite that, it was not picked up. On the other hand, the Linux kernel has historically been known to be slow with patch review. Apparently their regression handling is pretty solid nowadays!

My surprise comes from the fact that Arch could have carried this patch two (or at least one) releases earlier to make life of those affected easier. Sometimes that happens, just not this time.

Offline

#12 2018-07-14 12:36:15

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

Based on my search results for "Thinkpad_acpi: error probing battery 2", I think the
- Thinkpad 11e (R0B)
- Thinkpad 13 gen 2 (R0J)
could also benefit from my patch. Is there anyone with either of these machines available for testing?
If you see the error in your dmesg output, but have a different model, I would like to know as well.

Offline

#13 2018-07-24 17:27:15

jermizzey
Member
Registered: 2018-07-24
Posts: 4

Re: System freeze after upgrade to 4.17.2

jouke wrote:

Based on my search results for "Thinkpad_acpi: error probing battery 2", I think the
- Thinkpad 11e (R0B)
- Thinkpad 13 gen 2 (R0J)
could also benefit from my patch. Is there anyone with either of these machines available for testing?
If you see the error in your dmesg output, but have a different model, I would like to know as well.

11e here; I'd be interested in taking a look.

I should note that I was having the same issue as RX14, namely that the system would boot without issue but Xorg would then hang on startup. This behavior was intermittent, however — although the dmesg output always displays the "Thinkpad_acpi: error probing battery 2" error, Xorg only hangs about ~50% of the time.

Offline

#14 2018-07-25 14:06:31

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

Thanks for being willing to test! Here is the procedure.

Make sure you have the latest version of the linux package installed and that the thinkpad_acpi module is not blacklisted. If your kernel does not complain about probing battery 2, then your laptop does not require my code. Please let me know your laptop model id if this is the case. In other words, you should be able to find the error message using

dmesg | grep "thinkpad_acpi: Error probing battery 2"

The testing requires patching a kernel driver, for which we need some packages. As root, run

pacman -Sy --asdeps asp xmlto kmod inetutils bc libelf

Now, as a regular user, run

cd /tmp
    # or anywhere else

asp update linux
asp export linux
cd linux
curl -O https://gist.githubusercontent.com/joukewitteveen/8ae43aea7583e457ebe54250e9e77e17/raw/battery-quirk.patch
makepkg -o
    # Or makepkg -o --skippgpcheck if you trust your sources

cd src/linux-4.*/
patch -Np1 -i ../../battery-quirk.patch
    # This may produce some offset notifications

make modules_prepare
make M=drivers/platform/x86
xz drivers/platform/x86/thinkpad_acpi.ko

The module is now compiled. To install it, run, as root

cp -f drivers/platform/x86/thinkpad_acpi.ko.xz /usr/lib/modules/4.*-ARCH/kernel/drivers/platform/x86/

Reboot your machine and verify that the error message is gone

dmesg | grep "thinkpad_acpi: Error probing battery 2"

Moreover, advanced battery management should now be available. Verify that it is by running

ls /sys/class/power_supply/BAT1/charge_start_threshold 

Please report whether this file exists.

Thanks again!

Last edited by jouke (2018-07-25 18:26:08)

Offline

#15 2018-07-25 16:45:11

jermizzey
Member
Registered: 2018-07-24
Posts: 4

Re: System freeze after upgrade to 4.17.2

Hmm, after running through all of your steps (a couple of times, just to make sure I didn't mess anything up), I still get the

thinkpad_acpi: Error probing battery 2

error, and the file

/sys/class/power_supply/BAT1/charge_start_threshold

does not exist. I'm also now noticing that my dmesg has

battery: extension failed to load: ThinkPad Battery Extension
battery: extension unregistered: ThinkPad Battery Extension

as well; not sure to what extent these are related.


Laptop model:
  Lenovo ThinkPad 11e, model 20ED001HUS
Kernel version:
  4.17.9

System is up-to-date, and thinkpad_acpi is not blacklisted.

Offline

#16 2018-07-25 16:57:27

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

That is somewhat unexpected.

Shortly after posting, I updated my post. The initial version had a part copied from the bug report and compiled the battery driver instead of the thinkpad_acpi driver. Is it possible that you have followed the steps from the unedited post? If so, I am terribly sorry and owe you a beer.

What is the output of the patch command? Does it apply?

Offline

#17 2018-07-25 17:48:43

jermizzey
Member
Registered: 2018-07-24
Posts: 4

Re: System freeze after upgrade to 4.17.2

It seems to have applied, as far as I can tell (I'm a newb though so it's not unthinkable that I might just be misinterpreting something).

Output of patch command is the following:

patching file drivers/platform/x86/thinkpad_acpi.c                                 
Hunk #1 succeeded at 330 (offset -5 lines).                                        
Hunk #2 succeeded at 339 (offset -5 lines).                                        
Hunk #3 succeeded at 353 (offset -5 lines).                                        
Hunk #4 succeeded at 439 (offset -5 lines).                                        
Hunk #5 succeeded at 466 (offset -5 lines).                                        
Hunk #6 succeeded at 480 (offset -5 lines).                                        
Hunk #7 succeeded at 1651 (offset -5 lines).                                       
Hunk #8 succeeded at 1802 (offset -5 lines).                                       
Hunk #9 succeeded at 9417 (offset -12 lines).                                      
Hunk #10 succeeded at 9594 (offset -12 lines).                                     
Hunk #11 succeeded at 9821 (offset -12 lines).                                     
Hunk #12 succeeded at 9863 (offset -12 lines).                                     
Hunk #13 succeeded at 9883 (offset -12 lines).                                     
patch unexpectedly ends in middle of line                                          
Hunk #14 succeeded at 9906 with fuzz 1 (offset -12 lines).

Edit: forgot to mention that I did re-run the steps just a moment ago to verify, and nothing changed.

Last edited by jermizzey (2018-07-25 17:49:54)

Offline

#18 2018-07-25 18:33:13

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

You know what? That is actually a pretty cool result! I looked up your model number and apparently there are multiple versions of the 11e.

If I am not mistaken, the bios model of your thinkpad starts with JI

dmesg | grep thinkpad_acpi:.*model.*

I updated the patch so that it would also work for your model. I also updated the link to the gist in my earlier post so that it now downloads the latest version of the patch.
Inside /tmp/linux, you may remove the src/ directory (rm -r src/) and repeat the test from the curl -O ... step.

Offline

#19 2018-07-25 19:06:12

jermizzey
Member
Registered: 2018-07-24
Posts: 4

Re: System freeze after upgrade to 4.17.2

That seems to have done the trick!

jouke wrote:

If I am not mistaken, the bios model of your thinkpad starts with JI

Yes, BIOS version as given by dmesg is

thinkpad_acpi: ThinkPad BIOS JIET22WW (1.07 ), EC unknown

Re-ran the process from the curl -O ... step, and this time the patch command didn't have the patch unexpectedly ends in middle of line line, just the Hunk #[1-14] succeeded at...

Now dmesg no longer gives the battery error, and the

/sys/class/power_supply/BAT1/charge_start_threshold

file exists!

Thanks for the patch, and glad I could be of help with testing!

Offline

#20 2018-07-25 19:35:18

jouke
Member
Registered: 2009-10-14
Posts: 72

Re: System freeze after upgrade to 4.17.2

Bingo, that's one model verified. Thanks a lot jermizzey!
Anyone able to follow his example?

Documentation for the battery controls is being written: https://patchwork.kernel.org/patch/10396267/.

Offline

Board footer

Powered by FluxBB