tp-smapi-dkms FTBS on jammy with the latest linux 6.5

Bug #2046450 reported by Andrea Righi
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
tp-smapi (Ubuntu)
Confirmed
Undecided
Unassigned
Jammy
Fix Committed
Undecided
Unassigned

Bug Description

[Impact]

/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:42: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
   94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
      | ^
In file included from /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:45:
./include/linux/semaphore.h:34: note: macro "DEFINE_SEMAPHORE" defined here
   34 | #define DEFINE_SEMAPHORE(_name, _n) \
      |
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:8: error: type defaults to ‘int’ in declaration of ‘DEFINE_SEMAPHORE’ [-Werror=implicit-int]
   94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
      | ^~~~~~~~~~~~~~~~

[Test case]

 $ sudo apt install tp-smapi-dkms

[Fix]

Backport changes from mantic to support the new DEFINE_SEMAPHORE() ABI introduced in 6.5.

[Regression potential]

We may experience regressions in ThinkPad laptops (the only users of tp-smapi-dkms) especially with the new 6.5 kernel.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: tp-smapi-dkms 0.43-1ubuntu1
ProcVersionSignature: User Name 6.5.0-14.14~22.04.1-generic 6.5.3
Uname: Linux 6.5.0-14-generic x86_64
NonfreeKernelModules: zfs
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudID: nocloud
CloudName: unknown
CloudPlatform: nocloud
CloudSubPlatform: config-disk (/dev/vdb)
Date: Thu Dec 14 13:45:07 2023
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: tp-smapi
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Andrea Righi (arighi) wrote :
Revision history for this message
Andrea Righi (arighi) wrote :
Revision history for this message
Andrea Righi (arighi) wrote :

Wrong debdiff, ignore the previous message.

This is the correct debdiff.

Revision history for this message
Andrea Righi (arighi) wrote :

Test result with GA kernel and the new 6.5 (hwe) kernel:

Building for 5.15.0-91-generic
Building initial module for 5.15.0-91-generic
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

thinkpad_ec.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-91-generic/updates/dkms/

tp_smapi.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-91-generic/updates/dkms/

hdaps.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-91-generic/updates/dkms/

====================================

Building for 6.5.0-14-generic
Building initial module for 6.5.0-14-generic
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

thinkpad_ec.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.5.0-14-generic/updates/dkms/

tp_smapi.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.5.0-14-generic/updates/dkms/

hdaps.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/6.5.0-14-generic/updates/dkms/

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tp-smapi (Ubuntu Jammy):
status: New → Confirmed
Changed in tp-smapi (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

$ ubuntu-upload-permission -a -r jammy-proposed tp-smapi
All upload permissions for tp-smapi:

Component (universe)
====================
* MOTU (motu) [team]

Packagesets
===========

kernel-dkms:
* Ubuntu Kernel DKMS Uploaders (ubuntu-kernel-dkms-uploaders) [team]

You can upload tp-smapi to jammy-proposed.

So @arighi should be able to upload. Can you please re-upload, and monitor any errors and/or emails from like noreply@ to see if there is reject?

Revision history for this message
Andrea Righi (arighi) wrote :

New package uploaded with the proper version (0.43-1ubuntu1.1), thanks for the hint xnox!

Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Andrea, or anyone else affected,

Accepted tp-smapi into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/tp-smapi/0.43-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in tp-smapi (Ubuntu Jammy):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

I accidentally accepted this before noticing the bug is not marked as fixed in noble.

I tried to run the test case on mantic ('sudo apt install tp-smapi-dkms') and I found that this package
- has no maintainer scripts
- does not depend on dkms

So this is very much not fixed in noble because the package there is completely broken!

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

Hi arighi,

I reviewed the patch you submitted into jammy-devel, and I noticed that the following part is not from the upstream. Do you have any concerns about removing it? Thanks!

diff -urpN tp-smapi-0.43.orig/thinkpad_ec.mod tp-smapi-0.43/thinkpad_ec.mod
--- tp-smapi-0.43.orig/thinkpad_ec.mod 1970-01-01 00:00:00.000000000 +0000
+++ tp-smapi-0.43/thinkpad_ec.mod 2023-12-14 13:25:10.540430306 +0000
@@ -0,0 +1 @@
+/home/ubuntu/tp-smapi-0.43/thinkpad_ec.o

commit 0c3398b1acf2a2cabd9cee91dc3fe3d35805fa8b
Author: Evgeni Golov <email address hidden>
Date: Fri Jun 16 18:13:54 2023 +0200

    update DEFINE_SEMAPHORE usage for linux 6.4+

    Linux changed the DEFINE_SEMAPHORE macro in
    48380368dec14859723b9e3fbd43e042638d9a76, making it take two parameters
    instead of one. Pass an explicit 1 as on 6.4+.

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

We had an oem-priority bug for this issue.

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

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.