Unable to upgrade kernel, dpkg exiting with error on tp_sampi for Thinkpad

Ubuntu Support Template

Ubuntu Version:
25.10

Desktop Environment (if applicable):
GNOME

Problem Description:
I tried upgrading packages and moving from kernel 6.17.0-6-generic to 6.17.0-7-generic and get this error:

Autoinstall of module tp_smapi/0.44 for kernel 6.17.0-7-generic (x86_64)
Building module(s)...(bad exit status: 2)
Failed command:
make -j16 KERNELRELEASE=6.17.0-7-generic -C /lib/modules/6.17.0-7-generic/build M=/var/lib/dkms/tp_s
mapi/0.44/build HDAPS=1
/usr/share/apport/package-hooks/dkms_packages.py:101: DeprecationWarning: apport.fatal() is deprecat
ed. Please use apport.logging.fatal() directly instead.
  apport.fatal('Cannot create report: ' + str(e))
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/tp-smapi-dkms.0.crash'

Error! Bad return status for module build on kernel: 6.17.0-7-generic (x86_64)
Consult /var/lib/dkms/tp_smapi/0.44/build/make.log for more information.

and the /var/lib/dkms/tp_sampi/0.44/build/make.log reads:

DKMS (dkms-3.2.0) make.log for tp_smapi/0.44 for kernel 6.17.0-7-generic (x86_64)
Sat Nov 29 12:15:28 PST 2025

Building module(s)
# command: make -j16 KERNELRELEASE=6.17.0-7-generic -C /lib/modules/6.17.0-7-generic/build M=/var/lib/dkms/tp_smapi/0.44/build HDAPS=1
make: Entering directory '/usr/src/linux-headers-6.17.0-7-generic'
make[1]: Entering directory '/var/lib/dkms/tp_smapi/0.44/build'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
  You are using:           gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
  CC [M]  thinkpad_ec.o
  CC [M]  tp_smapi.o
  CC [M]  hdaps.o
hdaps.c: In function ‘hdaps_suspend’:
hdaps.c:430:9: error: implicit declaration of function ‘del_timer_sync’ [-Wimplicit-function-declaration]
  430 |         del_timer_sync(&hdaps_timer);
      |         ^~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-6.17.0-7-generic/scripts/Makefile.build:287: hdaps.o] Error 1
make[3]: *** Waiting for unfinished jobs....
thinkpad_ec.c: In function ‘check_dmi_for_ec’:
thinkpad_ec.c:471:1: warning: the frame size of 1728 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  471 | }
      | ^
make[2]: *** [/usr/src/linux-headers-6.17.0-7-generic/Makefile:2016: .] Error 2
make[1]: *** [/usr/src/linux-headers-6.17.0-7-generic/Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/var/lib/dkms/tp_smapi/0.44/build'
make: *** [Makefile:248: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.17.0-7-generic'

# exit code: 2
# elapsed time: 08:00:01
----------------------------------------------------------------

Relevant System Information:
Not sure what’s relevant here other than I’m running a Thinkpad T14s Gen5 AMD. Let me know if lshw would be helpful.

Any insight would be great, thank you!

In my opinion module tp_smpi is preventing the compiling of the newer Linux kernel because it is not compatible with the newer kernel. To get newer kernels to compile you will have to disable or remove module tp-smpi. To keep the functionality that module tp_smpi provides you will need to replace the module with a newer version from the supplier that is compatible with the newer Linux kernels. I cannot advise you on doing this.

This is the basis for my reasoning. I purchased a laptop from an OEM supplier with Ubuntu 20.04 LTS pre-installed. It came with a special keyboard driver that gave extra functionality to the keyboard.

I was able to keep this keyboard driver working when I installed Ubuntu 22.04 LTS and 24.04 LTS. Then 24.04 LTS moved from Linux kernel 6.11 to 6.14 and at first there was not a problem and then newer 6.14 kernels failed to compile.

I learnt two things.

(1) Removing the OEM keyboard driver would allow the newer kernels to compile. Of course, I lost the extra keyboard functions.
(2) Loading into an older Linux kernel where the keyboard driver still had functionally and then doing a re-start into the latest Linux kernel did not lose the extra functionality. This was the case when I loaded into Ubuntu 20.04 and then re-started into Ubuntu 24.04.

If you still have a Linux kernel that did compile with that module then make sure it does not get removed with apt autoremove.

I am only sharing my practical experience. It may be useful. It may not be.

regards

It does appear that upstream has fixed this bug in release 0.45 of the tp-smapi-dkms package and this has been in Debian since August.

Found the launchpad bug and it appears there’s a PPA with a patch that can work. https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/2114837

1 Like