If you’re using a ThinkPad laptop with Ubuntu Linux, you might be probably also using a package called acpi-call-dkms
. This package installs a kernel module that provides a way for software to do ACPI calls. One of the most popular program to use it – is TLP.
Unfortunately with the latest release of Ubuntu – 21.10 Impish Indri this package is partially broken, as it doesn’t seem to work with Linux kernel 5.13 because of a bug.
If you run Ubuntu 21.10 and have acpi-call-dkms
installed, you can check if it works for you by running this command:
sudo dmesg | grep "BUG: kernel NULL pointer dereference" -A 10
Code language: Bash (bash)
In my case among the lines there was something like this:
[45420.141212] BUG: kernel NULL pointer dereference, address: 0000000000000000
[45420.141217] #PF: supervisor instruction fetch in kernel mode
[45420.141220] #PF: error_code(0x0010) - not-present page
[45420.141221] PGD 0 P4D 0
[45420.141224] Oops: 0010 [#4] SMP NOPTI
[45420.141226] CPU: 3 PID: 85578 Comm: tpacpi-bat Tainted: G D O 5.13.0-19-generic #1
[45420.141229] Hardware name: LENOVO 20NLCTO1WW/20NLCTO1WW, BIOS R13ET49P(1.23 ) 11/24/2020
[45420.141231] RIP: 0010:0x0
[45420.141236] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[45420.141238] RSP: 0018:ffffa60ec2fc3ef0 EFLAGS: 00010246
Code language: PHP (php)
Because of that issue TLP can’t set battery charge thresholds, so if you want to preserve your laptop’s battery in good health, this issue won’t let you do that.
But worry not, as there’s a solution!
It seems like Canonical builds acpi-call-dkms
package from a rather outdated source – mkottman/acpi_call, while there’s another version of this module maintained by NixOS community: nix-community/acpi_call.
The latter works perfectly fine with the latest Linux version and that’s what we’re going to use.
Time needed: 5 minutes
Here’s how to make Ubuntu 21.10 work with acpi-call
- Remove previously installed acpi-call-dkms package (if any)
sudo apt purge acpi-call-dkms
- Install git (if you don’t have it installed yet)
sudo apt install git
- Clone the repository at nix-community/acpi_call
git clone --branch v1.2.2 https://github.com/nix-community/acpi_call.git
- Navigate to the cloned repository
cd acpi_call
- Prepare dkms.conf file
make dkms.conf
- Copy the module source to the shared sources directory
sudo cp -R . /usr/src/acpi-call-1.2.2
- Add the module to the dkms tree for build
sudo dkms add -m acpi-call -v 1.2.2
- Build the module
sudo dkms build -m acpi-call -v 1.2.2
- Install the module
sudo dkms install -m acpi-call -v 1.2.2
- Reboot
sudo reboot
Voila! Now acpi-call module will work again and TLP will be able to control battery charge thresholds.
13 thoughts on “Ubuntu 21.10 and acpi-call-dkms bug”
I am using Lenovo P50 with ubuntu 20.04, after installing driver my battery stopped charging. I tried uninstalling and move to default driver and install again. But it didnt help. Could you please let know how to fix this?
Linux TP-P50 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Hey Roger, have you also installed tlp?
Yes TLP is installed
> [ 36.254042] acpi_call: loading out-of-tree module taints kernel.
> [ 36.254077] acpi_call: module verification failed: signature and/or required key missing – tainting kernel
Don’t worry about that, it just says that you’re using a kernel module that’s not a part of the kernel sources.
> Yes TLP is installed
By default TLP will prevent your laptop battery from charging unless you have less than 75% of charge. That is to maintain battery life. You can change the charging thresholds yourself, here’s how: https://linrunner.de/tlp/faq/battery.html
Maybe this can be the problem?
[ 36.254042] acpi_call: loading out-of-tree module taints kernel.
[ 36.254077] acpi_call: module verification failed: signature and/or required key missing – tainting kernel
Excellent! Thanks so much…. was wasting some time on this setting up my new X1 nano
Thanks so much for this recipe, I’ve got a Lenovo X1 Carbon with a kde-neon (Ubuntu 20.04) installed, yesterday Ubuntu updated the hwe kernel to the 5.13 version and my laptop started to complain showing the kernel null pointer error. Searching a bit I found roadkell’s gist page and then yours, now it’s solved, for me and for some people around that also have Lenovo’s
Regards
—
Jaime
Hey Jaime,
I’m glad it helped you! 🙂
I get this error
modprobe: ERROR: could not insert ‘acpi_call’: Exec format error
Hey Anthony,
Could you try the following steps?
1)
sudo rm -Rf /usr/src/acpi-call-1.2.2
2)
rm -Rf ~/acpi-call
3)
sudo dkms remove acpi-call/1.2.2 --all
4)
git clone --branch v1.2.2 [email protected]:nix-community/acpi_call.git
And then repeat the steps 4 – 10 of the guide.
Hey Andrei,
I am newbie to Linux, I am using Kubuntu 21.10. I just reinstalled Kubuntu after I left my comment here and then followed the steps from start to finish and after reboot, I run the command “modprobe acpi_call” while in sudo su and then voila it worked. Thanks
Thank you!!
From my batteries 🙂
Hey Royden, you’re welcome! 🙂