Monosoul's Dev Blog A blog to write down dev-related stuff I face
Ubuntu 21.10 Impish Indri

Ubuntu 21.10 and acpi-call-dkms bug

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

  1. Remove previously installed acpi-call-dkms package (if any)

    sudo apt purge acpi-call-dkms

  2. Install git (if you don’t have it installed yet)

    sudo apt install git

  3. Clone the repository at nix-community/acpi_call

    git clone --branch v1.2.2 https://github.com/nix-community/acpi_call.git

  4. Navigate to the cloned repository

    cd acpi_call

  5. Prepare dkms.conf file

    make dkms.conf

  6. Copy the module source to the shared sources directory

    sudo cp -R . /usr/src/acpi-call-1.2.2

  7. Add the module to the dkms tree for build

    sudo dkms add -m acpi-call -v 1.2.2

  8. Build the module

    sudo dkms build -m acpi-call -v 1.2.2

  9. Install the module

    sudo dkms install -m acpi-call -v 1.2.2

  10. Reboot

    sudo reboot

Voila! Now acpi-call module will work again and TLP will be able to control battery charge thresholds.

Like it? Share it!

Leave a comment

Your email address will not be published.

13 thoughts on “Ubuntu 21.10 and acpi-call-dkms bug”

    • Andrei Nevedomskii
        • Andrei Nevedomskii
    • Andrei Nevedomskii