ddcci-driver-linux: build error with linux 5.15 on jammy

Bug #1951608 reported by Andrea Righi
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ddcci-driver-linux (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

ddcci dkms is failing to build with the latest 5.15 kernel on jammy:

CC [M] /var/lib/dkms/ddcci/0.4.1/build/ddcci/ddcci.o
/var/lib/dkms/ddcci/0.4.1/build/ddcci/ddcci.c:1295:27: error: initialization of ‘void (*)(struct device *)’ from incompatible pointer type ‘int (*)(struct device *)’ [-Werror=incompatible-pointer-types]
 1295 | .remove = ddcci_device_remove
      | ^~~~~~~~~~~~~~~~~~~

[Test case]

sudo apt install ddcci-dkms

[Fix]

The signature of struct bus_type.remove changed to a void function, we just need to adjust the handler with kernels >= 5.15.

[Regression potential]

We may have ddcci-dkms regressions with old kernels if the patch is not doing the right thing, but the change is really minimal, so the risk of regressions is very low.

Andrea Righi (arighi)
no longer affects: linux (Ubuntu)
no longer affects: linux (Ubuntu Jammy)
Revision history for this message
Andrea Righi (arighi) wrote :

Attached debdiff seems to fix the build error on 5.15 (tested in jammy with the latest kernel from -proposed).

tags: added: patch
Andrea Righi (arighi)
summary: - build error with linux 5.15 on jammy
+ ddcci-driver-linux: build error with linux 5.15 on jammy
Andrea Righi (arighi)
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

ddcci-driver-linux (0.4.1-2) unstable; urgency=medium

  * Adjust to build with kernel 5.15. Closes: #1000357.

 -- Stephen Kitt <email address hidden> Mon, 22 Nov 2021 18:24:42 +0100

Changed in ddcci-driver-linux (Ubuntu Jammy):
status: New → Invalid
Revision history for this message
Andrea Righi (arighi) wrote :

It looks like it's still broken:

  CC [M] /home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci/ddcci.o
/home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci/ddcci.c: In function ‘ddcci_device_remove’:
/home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci/ddcci.c:1283:24: error: ‘return’ with a value, in function returning void [-Werror=return-type]
 1283 | return -EINVAL;
      | ^
/home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci/ddcci.c:1273:13: note: declared here
 1273 | static void ddcci_device_remove(struct device *dev)
      | ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:285: /home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci/ddcci.o] Error 1
make[2]: *** [Makefile:1880: /home/ubuntu/ddcci/ddcci-driver-linux-0.4.1/ddcci] Error 2

This is because ddcci_device_remove() is defined as void in 5.15, but there's a return -EINVAL in the body.

The fix for this is trivial, I'll post another debdiff.

Changed in ddcci-driver-linux (Ubuntu Jammy):
status: Invalid → Confirmed
Revision history for this message
Andrea Righi (arighi) wrote :

debdiff that fixes the new build error.

Changed in ddcci-driver-linux (Ubuntu Jammy):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ddcci-driver-linux - 0.4.1-3ubuntu1

---------------
ddcci-driver-linux (0.4.1-3ubuntu1) jammy; urgency=medium

  [ Andrea Righi ]
  * Fix build error on linux 5.15 (LP: #1951608)
    - debian/patches/0010-fix-build-error-with-linux-5.15.patch

  [ Dimitri John Ledkov ]
  * Drop the Debian's patch in favor of a better upstream patch
    cherrypicked by Andrea.

 -- Dimitri John Ledkov <email address hidden> Thu, 25 Nov 2021 15:33:56 +0000

Changed in ddcci-driver-linux (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Andy Whitcroft (apw) wrote : Please test proposed package

Hello Andrea, or anyone else affected,

Accepted ddcci-driver-linux into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ddcci-driver-linux/0.3.3-1ubuntu0.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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 ddcci-driver-linux (Ubuntu Focal):
status: New → Fix Committed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

1) launched focal lxd container
2) enabled proposed
3) installed the v5.15 based kernel
apt install linux-generic-hwe-20.04-edge
4) disabled proposed

5) observed that it fails to install

Loading new ddcci-0.3.3 DKMS files...
BACKLIGHT_CLASS_DEVICE disabled in this kernel, not building module.
It is likely that 5.13.0-40-generic belongs to a chroot's host
Building for 5.15.0-25-generic
Building initial module for 5.15.0-25-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/ddcci-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.15.0-25-generic (x86_64)
Consult /var/lib/dkms/ddcci/0.3.3/build/make.log for more information.
dpkg: error processing package ddcci-dkms (--configure):
 installed ddcci-dkms package post-installation script subprocess returned error exit statu
s 10
Errors were encountered while processing:
 ddcci-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

6) enabled proposed once again

7) observed that from proposed installs & builds fine

Setting up ddcci-dkms (0.3.3-1ubuntu0.1) ...
Loading new ddcci-0.3.3 DKMS files...
BACKLIGHT_CLASS_DEVICE disabled in this kernel, not building module.
It is likely that 5.13.0-40-generic belongs to a chroot's host
Building for 5.15.0-25-generic
Building initial module for 5.15.0-25-generic
Done.

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

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

depmod...

DKMS: install completed.

tags: added: verification-done verification-focal-done
tags: added: verification-done-focal
removed: verification-focal-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ddcci-driver-linux - 0.3.3-1ubuntu0.1

---------------
ddcci-driver-linux (0.3.3-1ubuntu0.1) focal; urgency=medium

  * Cherry-pick fix for failing to build from source on linux 5.15 from
    jammy. (LP: #1951608)

 -- Dimitri John Ledkov <email address hidden> Tue, 05 Apr 2022 16:19:23 +0100

Changed in ddcci-driver-linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ddcci-driver-linux has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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