ipu6-drivers module should not try to build when CONFIG_I2C is disabled

Bug #2012407 reported by Roxana Nicolescu
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ipu6-drivers (Ubuntu)
Fix Released
High
You-Sheng Yang
Jammy
In Progress
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned
Lunar
Won't Fix
Undecided
Unassigned
Mantic
Fix Released
High
You-Sheng Yang

Bug Description

SRU justification:

[Impact]

This is encountered on linux kernel derivatives with fewer configuration options enabled.
First time seen on jammy:linux-kvm-1029.

During build, it fails with the following error:
...
Building module:
cleaning build area...
make -j1 KERNELRELEASE=5.15.0-1030-kvm KERNELRELEASE=5.15.0-1030-kvm KERNEL_SRC=/lib/modules/5.15.0-1030-kvm/build...........(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.15.0-1030-kvm (x86_64)
Consult /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/make.log for more information.
E: ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1 failed to build for 5.15.0-1030-kvm
========== /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/make.log ==========
DKMS make.log for ipu6-drivers-0~git202211220708.278b7e3d-0ubuntu0.22.04.1 for kernel 5.15.0-1030-kvm (x86_64)
Wed Mar 8 23:42:18 UTC 2023
make -C /lib/modules/5.15.0-1030-kvm/build M=/var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-1030-kvm'
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-bus.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-dma.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-mmu.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-buttress.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-trace.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-cpd.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/ipu6.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-fw-com.o
  CC [M] /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-isys-bridge.o
/var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-isys-bridge.c: In function ‘ipu_isys_bridge_unregister_sensors’:
/var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-isys-bridge.c:283:17: error: implicit declaration of function ‘i2c_unregister_device’; did you mean ‘pci_unregister_driver’? [-Werror=implicit-function-declaration]
  283 | i2c_unregister_device(sensor->vcm_i2c_client);
      | ^~~~~~~~~~~~~~~~~~~~~
      | pci_unregister_driver
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:297: /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6/../ipu-isys-bridge.o] Error 1
make[3]: *** [scripts/Makefile.build:560: /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel/ipu6] Error 2
make[2]: *** [scripts/Makefile.build:560: /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/drivers/media/pci/intel] Error 2
make[1]: *** [Makefile:1906: /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-1030-kvm'
make: *** [Makefile:37: all] Error 2
====================
./ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.1/build/make.log
autopkgtest [23:42:45]: test dkms-autopkgtest: -----------------------]
autopkgtest [23:42:46]: test dkms-autopkgtest: - - - - - - - - - - results - - - - - - - - - -
dkms-autopkgtest FAIL non-zero exit status 1
autopkgtest [23:42:46]: @@@@@@@@@@@@@@@@@@@@ summary

because CONFIG_I2C=n

[Fix]

Add a rule to avoid building ipu6-drivers when CONFIG_VIDEO_V4L2_I2C=n

[Test Plan]

```
$ sudo apt-get install linux-headers-kvm
$ grep -nr CONFIG_VIDEO_V4L2_I2C= /usr/src/linux-*-kvm/.config || echo "No CONFIG_VIDEO_V4L2_I2C"
No CONFIG_VIDEO_V4L2_I2C
$ sudo apt-get install intel-ipu6-dkms
```

Once the package is in proposed, a new adt is triggered against proposed for jammy:linux-kvm.

[Where problems could occur]

Low possibility of new issues.

[Note]

This fix is not scalable in the sense that if configuration name changes, the module has to be changed as well.

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

proposed fix is attached

Tested on jammy:linux:kvm-1029
ubuntu@jammy-kvm:~/ipu6-drivers$ sudo dpkg -i intel-ipu6-dkms_0~git202211220708.278b7e3d-0ubuntu0.22.04.2_amd64.deb
Selecting previously unselected package intel-ipu6-dkms.
(Reading database ... 142171 files and directories currently installed.)
Preparing to unpack intel-ipu6-dkms_0~git202211220708.278b7e3d-0ubuntu0.22.04.2_amd64.deb ...
Unpacking intel-ipu6-dkms (0~git202211220708.278b7e3d-0ubuntu0.22.04.2) ...
Setting up intel-ipu6-dkms (0~git202211220708.278b7e3d-0ubuntu0.22.04.2) ...
Loading new ipu6-drivers-0~git202211220708.278b7e3d-0ubuntu0.22.04.2 DKMS files...
Building for 5.15.0-1029-kvm
Building initial module for 5.15.0-1029-kvm
Error! The /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.04.2/5.15.0-1029-kvm/x86_64/dkms.conf for module ipu6-drivers includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch.
This indicates that it should not be built.
Skipped.

tags: added: sru-20230227
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "ipu6-drivers.patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

YES PLEASE!!!!!!!

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

This is needed for kinetic too.
I attached the debdiff.

Tested on a local vm:
ubuntu@kinetic:~/ipu6-drivers$ sudo dpkg -i intel-ipu6-dkms_0~git202211220708.278b7e3d-0ubuntu0.22.10.2_amd64.deb
Selecting previously unselected package intel-ipu6-dkms.
(Reading database ... 135914 files and directories currently installed.)
Preparing to unpack intel-ipu6-dkms_0~git202211220708.278b7e3d-0ubuntu0.22.10.2_amd64.deb ...
Unpacking intel-ipu6-dkms (0~git202211220708.278b7e3d-0ubuntu0.22.10.2) ...
Setting up intel-ipu6-dkms (0~git202211220708.278b7e3d-0ubuntu0.22.10.2) ...
Loading new ipu6-drivers-0~git202211220708.278b7e3d-0ubuntu0.22.10.2 DKMS files...
Building for 5.19.0-1021-kvm
Building initial module for 5.19.0-1021-kvm
Error! The /var/lib/dkms/ipu6-drivers/0~git202211220708.278b7e3d-0ubuntu0.22.10.2/5.19.0-1021-kvm/x86_64/dkms.conf for module ipu6-drivers includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config.
This indicates that it should not be built.
Skipped.
ubuntu@kinetic:~/ipu6-drivers$

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Why do we need to install this against kvm kernel? There is never the corresponding hardware in a virtual machine.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Since this package is for a specific hardware, it's clearly that this test is not suitable to run on KVM kernels.

We should probably skip it.

Revision history for this message
You-Sheng Yang (vicamo) wrote :
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Patches in comment #1 and #4 wrongly put BUILD_EXCLUSIVE_CONFIG as BUILD_EXCLUSIVE_KERNEL. I'm marking this as WONTFIX then.

Changed in ipu6-drivers (Ubuntu):
status: New → Won't Fix
Changed in ipu6-drivers (Ubuntu Jammy):
status: New → Won't Fix
Changed in ipu6-drivers (Ubuntu Kinetic):
status: New → Won't Fix
Revision history for this message
Roxana Nicolescu (roxanan) wrote :

https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/2012612 is done. new dkms version is in proposed.
So Jammy is unblocked.
This is also needed for kinetic and lunar. Kientic won't be fixed because it's going to be dropped very soon, but it is necessary for lunar.
Reminder for lunar: in kernel-version, this was removed from lunar:main and it affects derivatives. When this is fixed, that can reverted.

Changed in ipu6-drivers (Ubuntu):
status: Won't Fix → Confirmed
Changed in ipu6-drivers (Ubuntu Jammy):
status: Won't Fix → Confirmed
Changed in ipu6-drivers (Ubuntu Kinetic):
status: Won't Fix → Confirmed
status: Confirmed → Won't Fix
Revision history for this message
You-Sheng Yang (vicamo) wrote :

I'm to upload one with bug 2021740 as well.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

See bug 2021740 for proposed debdiff.

Changed in ipu6-drivers (Ubuntu Mantic):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → You-Sheng Yang (vicamo)
You-Sheng Yang (vicamo)
Changed in ivsc-driver (Ubuntu Kinetic):
status: New → Won't Fix
You-Sheng Yang (vicamo)
no longer affects: ivsc-driver (Ubuntu)
no longer affects: ivsc-driver (Ubuntu Jammy)
no longer affects: ivsc-driver (Ubuntu Kinetic)
no longer affects: ivsc-driver (Ubuntu Lunar)
no longer affects: ivsc-driver (Ubuntu Mantic)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ipu6-drivers (Ubuntu Lunar):
status: New → Confirmed
Revision history for this message
QuasarApp group (quasarrapp) wrote :

at now i have a similar issue with cernel 6.5.0.9

Building module:
Cleaning build area...
make -j8 KERNELRELEASE=6.5.0-9-generic KERNELRELEASE=6.5.0-9-generic KERNEL_SRC=
/lib/modules/6.5.0-9-generic/build...(bad exit status: 2)
ERROR (dkms apport): binary package for ipu6-drivers: 0.0.0 not found
Error! Bad return status for module build on kernel: 6.5.0-9-generic (x86_64)
Consult /var/lib/dkms/ipu6-drivers/0.0.0/build/make.log for more information.
dkms autoinstall on 6.5.0-9-generic/x86_64 succeeded for virtualbox
dkms autoinstall on 6.5.0-9-generic/x86_64 failed for ipu6-drivers(10)
Error! One or more modules failed to install during autoinstall.

You-Sheng Yang (vicamo)
description: updated
You-Sheng Yang (vicamo)
description: updated
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Proposed lunar/jammy debdiff in bug 2021740. To update debdiff for mantic. For noble, it's included in bug 2031412.

Changed in ipu6-drivers (Ubuntu Mantic):
status: In Progress → Triaged
Changed in ipu6-drivers (Ubuntu Lunar):
status: Confirmed → In Progress
Changed in ipu6-drivers (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ipu6-drivers - 0~git202310180730.3f813580-0ubuntu0.24.04.1

---------------
ipu6-drivers (0~git202310180730.3f813580-0ubuntu0.24.04.1) noble; urgency=low

  [ Hao Yao ]
  * New upstream 20230802_1500_mtl_plat release.
  * New upstream 20230911_0620_mtl_plat_pv release.

  [ Hans de Goede ]
  * Fix compilation with kernels >= 6.5.0 (LP: #2026402)
    - ipu-psys: Fix compilation with kernels >= 6.5.0
    - ipu6: Fix compilation with kernels >= 6.6.0
    - ipu6: Fix sensor driver compilation with kernels >= 6.6.0

  [ You-Sheng Yang ]
  * Support mipi camera on Intel Meteor Lake platform (LP: #2031412)
    - debian: refresh patches
  * dkms: add CONFIG_VIDEO_V4L2_I2C to BUILD_EXCLUSIVE_CONFIG (LP: #2012407)
  * debian: add modaliases (LP: #2021740)
  * UBUNTU: SAUCE: i2c: compile omitted sensor drivers

 -- You-Sheng Yang <email address hidden> Fri, 01 Sep 2023 17:51:53 +0800

Changed in ipu6-drivers (Ubuntu):
status: In Progress → Fix Released
You-Sheng Yang (vicamo)
Changed in ipu6-drivers (Ubuntu Mantic):
status: Triaged → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote :

The changelog does not clearly document which changes in the debdiff are related to which bug, making review challenging.

debian/patches/0003-build-fix-kernel-feature-macro-definitions.patch contains substantive changes, e.g.:

+@@ -59,18 +58,16 @@ MODSRC := $(shell pwd)
+ ccflags-y += -I$(src)/backport-include/drivers/misc/mei/
+
+ subdir-ccflags-y += -I$(src)/include/ \
+- -DCONFIG_VIDEO_V4L2_SUBDEV_API
++ -DCONFIG_VIDEO_V4L2_SUBDEV_API=1

Which of the bugs in the changelog is this related to?

Changed in ipu6-drivers (Ubuntu Mantic):
status: In Progress → Incomplete
Revision history for this message
You-Sheng Yang (vicamo) wrote :

No, you trying to review all the detailed changes with a summarized debian/changelog is wrong.

If you really want to know all the details, which line is committed for waht, go to https://code.launchpad.net/~canonical-hwe-team/hwe-next/+git/intermediate-dkms and checkout the git history, and you will find it's under a commit titled "debian: refresh patch", under a new upstream 20230802_1500_mtl_plat release for bug 2031412.

Changed in ipu6-drivers (Ubuntu Mantic):
status: Incomplete → In Progress
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Roxana, or anyone else affected,

Accepted ipu6-drivers into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ipu6-drivers/0~git202310180730.3f813580-0ubuntu0.23.10.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-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. 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 ipu6-drivers (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
You-Sheng Yang (vicamo) wrote :

verified ipu6-drivers/mantic-proposed version 0~git202310180730.3f813580-0ubuntu0.23.10.1

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

This bug was fixed in the package ipu6-drivers - 0~git202310180730.3f813580-0ubuntu0.23.10.1

---------------
ipu6-drivers (0~git202310180730.3f813580-0ubuntu0.23.10.1) mantic; urgency=low

  [ You-Sheng Yang ]
  * New upstream release
    - Support mipi camera on Intel Meteor Lake platform (LP: #2031412)
    - debian: refresh patches, drop upstreamed ones
  * d/patches/0007: add CONFIG_VIDEO_V4L2_I2C to BUILD_EXCLUSIVE_CONFIG
    (LP: #2012407)
  * debian: add modaliases (LP: #2021740)

 -- You-Sheng Yang <email address hidden> Fri, 01 Sep 2023 17:51:53 +0800

Changed in ipu6-drivers (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for ipu6-drivers 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.

Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.04 (Lunar Lobster) has reached end of life, so this bug will not be fixed for that specific release.

Changed in ipu6-drivers (Ubuntu Lunar):
status: In Progress → Won't Fix
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.