[SRU]crash when installing tp-smapi

Bug #2035561 reported by Khairul Aizat Kamarudzzaman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Triaged
Critical
Bin Li
tp-smapi (Ubuntu)
New
Undecided
Unassigned

Bug Description

[Impact]
tp-smapi-dkms is a kernel module exposes some features of the ThinkPad
hardware/firmware via a sysfs interface. It will crash after 6.4 kernel.
In OEM projects, we met this issue on 6.5.0-oem kernel. And it blocks our
QA team to install hdapsd, because it's in "Recommends: tp-smapi-dkms".

[Test case]
On 22.04, just run below command.
$ sudo apt install tp-smapi-dkms

Loading new tp_smapi-0.43 DKMS files...
Building for 6.5.0-1008-oem
Building initial module for 6.5.0-1008-oem
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.5.0-1008-oem (x86_64)
Consult /var/lib/dkms/tp_smapi/0.43/build/make.log for more information.
dpkg: error processing package tp-smapi-dkms (--configure):
 installed tp-smapi-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 tp-smapi-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

[Potential regression]
It's low risk, cherry-pick from uptream, it uses KERNEL_VERSION MACRO to support 6.4+ kernel.
Linux changed the DEFINE_SEMAPHORE macro in
48380368dec14859723b9e3fbd43e042638d9a76, making it take two parameters
instead of one. Pass an explicit 1 as on 6.4+.

 /* Locking: */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 static DECLARE_MUTEX(thinkpad_ec_mutex);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
 static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
+#else
+static DEFINE_SEMAPHORE(thinkpad_ec_mutex, 1);
 #endif

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :
Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

tp-smapi-dkms.0.crash

Revision history for this message
Rimas Kudelis (rq) wrote :

Doesn't build on Pop!_OS 22.04 either.

There's been a new release on https://github.com/linux-thinkpad/tp_smapi, version 0.44, which adds support for kernels 6.4 and up. It would be great to get an updated package which actually builds.

Revision history for this message
Bin Li (binli) wrote :

Hi fenris,

This issue should be fixed in mantic now, could you help check if you could reproduce this issue again? Thanks!

https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/2035559

summary: - crash when installing tp-smapi
+ [SRU]crash when installing tp-smapi
Revision history for this message
Bin Li (binli) wrote :

On 22.04, it failed to build with 6.5.0-oem kernel, which is blocked our testing in checkbox and fwts.

Changed in oem-priority:
assignee: nobody → Bin Li (binli)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
Bin Li (binli) wrote :
description: updated
Revision history for this message
Bin Li (binli) wrote :

On lunar, it's same version with jammy, so this debdiff could work on lunar too.

tp-smapi (0.43-1ubuntu1) impish; urgency=medium

  * Restrict this module to amd64 (LP: #1945784)

Changed in oem-priority:
status: In Progress → Triaged
Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

fenris@ThinkPad-P1 ~> sudo apt install tp-smapi-dkms
[sudo] password for fenris:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  tp-smapi-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.3 kB of archives.
After this operation, 121 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu mantic/universe amd64 tp-smapi-dkms amd64 0.44-1ubuntu1 [32.3 kB]
Fetched 32.3 kB in 8s (4,118 B/s)
Selecting previously unselected package tp-smapi-dkms.
(Reading database ... 391838 files and directories currently installed.)
Preparing to unpack .../tp-smapi-dkms_0.44-1ubuntu1_amd64.deb ...
Unpacking tp-smapi-dkms (0.44-1ubuntu1) ...
Setting up tp-smapi-dkms (0.44-1ubuntu1) ...
fenris@ThinkPad-P1 ~>

Revision history for this message
Bin Li (binli) wrote :

Yes, this issue is fixed from mantic or tp-smapi-dkms 0.44-1. We need backport it into 22.04, 22.10 and 23.04.

tp-smapi (0.44-1) unstable; urgency=medium

  * New upstream version 0.44
    + Support 6.4 kernel
      Closes: #1038207

Revision history for this message
Bin Li (binli) wrote :

Updated it with a bug number.

Revision history for this message
Simon Quigley (tsimonq2) wrote :

Hi binli, I hope this finds you well.

A few review points for your patch:
 - The version should be 0.43-1ubuntu1.1, not 0.43-1ubuntu2. See this page[1] for more information on SRU (and security update) versioning.
 - Most sponsors (in my experience) prefer DEP-3 headers[2]. It's not a hard blocker, but I would really like to see that.

Could you also expand a little further on the SRU template, specifically the regression potential, citing specific examples? The more (useful) information there, the better.

Please re-subscribe ubuntu-sponsors once you're able to follow up. Thanks for your work.

[1] https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging #2
[2] https://dep-team.pages.debian.net/deps/dep3/ (or remove the header, push the patch to the top of the stack, and run `quilt header --dep3 -e`)

Revision history for this message
Bin Li (binli) wrote :

Hi Simon,

 Apologies, I missed your comment. I only noticed it today after my colleague brought it to my attention. I've updated the source code from jammy-devel and observed that Andrea has uploaded a patch for this issue in LP: #2046450 . I'll keep your suggestions in mind for the next SRU. Thanks a lot!

tp-smapi (0.43-1ubuntu1.1) jammy; urgency=medium

  * Support Linux 6.5 ABI (LP: #2046450):
    - debian/patches/0010-support-linux-6.5.patch

 -- Andrea Righi <email address hidden> Thu, 14 Dec 2023 13:41:22 +0000

Rex Tsai (chihchun)
tags: added: oem-priority
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.