Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure: missing linux/vsc.h #13

Closed
vicamo opened this issue Apr 27, 2022 · 24 comments · Fixed by #50
Closed

build failure: missing linux/vsc.h #13

vicamo opened this issue Apr 27, 2022 · 24 comments · Fixed by #50

Comments

@vicamo
Copy link
Contributor

vicamo commented Apr 27, 2022

$ make -j EXTERNAL_BUILD=1
make -C /lib/modules/`uname -r`/build M=/work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-25-generic'
  CC [M]  /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov01a10.o
  CC [M]  /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov02c10.o
/work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov02c10.c:14:10: fatal error: linux/vsc.h: No such file or directory
   14 | #include <linux/vsc.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:285: /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov02c10.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov01a10.c:14:10: fatal error: linux/vsc.h: No such file or directory
   14 | #include <linux/vsc.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:285: /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c/ov01a10.o] Error 1
make[2]: *** [scripts/Makefile.build:548: /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers/drivers/media/i2c] Error 2
make[1]: *** [Makefile:1875: /work/vicamo/canonical/dkms/ipu6-drivers/ipu6-drivers] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-25-generic'
make: *** [Makefile:22: all] Error 2
@vicamo
Copy link
Contributor Author

vicamo commented Apr 27, 2022

How about moving ov01a10 and ov02c10 into ivsc-drivers? I didn't find there is a directly dependency to ipu6-drivers but ivsc.

@kfechter
Copy link

I added the vsc,h from the ivsc-drivers repo, which gets the build past that error. however, there is another error right after

LD [M] /home/kfechter/Downloads/ipu6-drivers-master/drivers/media/pci/intel/ipu6/intel-ipu6.o LD [M] /home/kfechter/Downloads/ipu6-drivers-master/drivers/media/pci/intel/ipu6/intel-ipu6-isys.o LD [M] /home/kfechter/Downloads/ipu6-drivers-master/drivers/media/pci/intel/ipu6/intel-ipu6-psys.o MODPOST /home/kfechter/Downloads/ipu6-drivers-master/Module.symvers ERROR: modpost: "vsc_release_camera_sensor" [/home/kfechter/Downloads/ipu6-drivers-master/drivers/media/i2c/ov02c10.ko] undefined! ERROR: modpost: "vsc_acquire_camera_sensor" [/home/kfechter/Downloads/ipu6-drivers-master/drivers/media/i2c/ov02c10.ko] undefined! ERROR: modpost: "vsc_release_camera_sensor" [/home/kfechter/Downloads/ipu6-drivers-master/drivers/media/i2c/ov01a10.ko] undefined! ERROR: modpost: "vsc_acquire_camera_sensor" [/home/kfechter/Downloads/ipu6-drivers-master/drivers/media/i2c/ov01a10.ko] undefined! make[2]: *** [scripts/Makefile.modpost:134: /home/kfechter/Downloads/ipu6-drivers-master/Module.symvers] Error 1 make[2]: *** Deleting file '/home/kfechter/Downloads/ipu6-drivers-master/Module.symvers' make[1]: *** [Makefile:1750: modules] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.17.0-1003-oem' make: *** [Makefile:22: all] Error 2

@cjechlitschek
Copy link
Contributor

At this moment, the vsc driver needs to be built as part of the kernel so that the sensor drivers can link against it.

@vicamo
Copy link
Contributor Author

vicamo commented Apr 29, 2022

At this moment, the vsc driver needs to be built as part of the kernel so that the sensor drivers can link against it.

I'm afraid that's not gonna happen any more as Intel has no interest in upstreaming this any time soon. It has to be a standaline dkms. That's all.

So this, missing client.h/hbm.h/... problem, can be fixed by carrying those header files inside ivsc-drivers, then that's what has to be done. And since now ivsc fails to build against v5.18-rc3 or newer due to DMA API changes, you'll need some kind of version guards like #12 as well.

@vicamo
Copy link
Contributor Author

vicamo commented Apr 29, 2022

At this moment, the vsc driver needs to be built as part of the kernel so that the sensor drivers can link against it.

I'm afraid that's not gonna happen any more as Intel has no interest in upstreaming this any time soon. It has to be a standaline dkms. That's all.

And please note we are expecting your commitment into CI tests for both ipu6-drivers and ivsc-drivers.

@wentongwu
Copy link
Contributor

At this moment, the vsc driver needs to be built as part of the kernel so that the sensor drivers can link against it.

I'm afraid that's not gonna happen any more as Intel has no interest in upstreaming this any time soon. It has to be a standaline dkms. That's all.

And please note we are expecting your commitment into CI tests for both ipu6-drivers and ivsc-drivers.

what the CI tests will be? Can you please add some extra commands to clone/wget the missing header files from https://github.com/torvalds/linux/tree/master/drivers/misc/mei after git clone ivsc driver code?

@wentongwu
Copy link
Contributor

@vicamo if just copying these missing header files into ivsc driver repo, we have to take much effort to maintain these header files which are not developed by us as kernel upgrades.

@vicamo
Copy link
Contributor Author

vicamo commented May 4, 2022

@vicamo if just copying these missing header files into ivsc driver repo, we have to take much effort to maintain these header files which are not developed by us as kernel upgrades.

Then you probably now understand how downstream kernel vendors struggled to maintain your ivsc driver between kernel versions. Again, we're expecting them being built as dkms.

@wentongwu
Copy link
Contributor

wentongwu commented May 4, 2022

@vicamo if just copying these missing header files into ivsc driver repo, we have to take much effort to maintain these header files which are not developed by us as kernel upgrades.

Then you probably now understand how downstream kernel vendors struggled to maintain your ivsc driver between kernel versions. Again, we're expecting them being built as dkms.

please note copying these header files into ivsc driver repo may break other modules if vendors still follow the current building way. Is that ok for you to make another branch for dkms?

@vicamo
Copy link
Contributor Author

vicamo commented May 4, 2022

@vicamo if just copying these missing header files into ivsc driver repo, we have to take much effort to maintain these header files which are not developed by us as kernel upgrades.

Then you probably now understand how downstream kernel vendors struggled to maintain your ivsc driver between kernel versions. Again, we're expecting them being built as dkms.

See intel/ivsc-driver#13. Next is to move the two affected sensors here into ivsc either in your repo or in our debian package.

please note copying these header files into ivsc driver repo may break other modules if vendors still follow the current building way. Is that ok for you to make another branch for dkms?

No.

@wentongwu
Copy link
Contributor

wentongwu commented May 4, 2022

Ok, but actually I'm trying to take out the structure and function declaration needed into a separate header file to reduce the maintain effort. Anyway thanks for your PR.

@bk2204
Copy link

bk2204 commented Jun 21, 2022

Is there a good way to get the modpost error fixed for those of us using the DKMS build (in my case, using Debian sid's 5.18.0-2-amd64)? I've built and installed the ivsc-driver already with DKMS.

@zebra-ok
Copy link

Did anyone get past these MODPOST errors? Trying to build this driver on Fedora 36.

@vicamo
Copy link
Contributor Author

vicamo commented Jul 20, 2022

Did anyone get past these MODPOST errors? Trying to build this driver on Fedora 36.

https://launchpad.net/~vicamo/+archive/ubuntu/ppa-1972109
https://launchpad.net/~vicamo/+archive/ubuntu/ppa-1972106
Source code branches in the PPA description.

@zebra-ok
Copy link

zebra-ok commented Jul 21, 2022

Thanks! I cloned the repos, applied the patches in debian/patches, and built sucessfully with dkms on kernel 5.18.11. Camera works now!

@thepiwo
Copy link

thepiwo commented Jul 22, 2022

@zebra-ok did you just install the dkms modules for those both projects or anything else? Building and installing worked well, but a camera device is not showing up for me.

@netllama
Copy link

@zebra-ok I'm also trying to get this working on Fedora36, but am struggling to make any real progress. The patches don't apply cleanly for me, and I can't get this repo or the 'hal' repo to build successfully currently.

Any chance you could provide more details on what order you built and patched everything to get the camera working?

@Thesola10
Copy link

Thesola10 commented Jul 28, 2022

so there's no way for a DKMS module to depend on another DKMS module? Would an approach based on kprobe like in xcellerator/linux_kernel_hacking#3 work?

I'm currently writing an Arch Linux PKGBUILD for the IPU6 camera stack but getting stuck on this very issue.

@paulmenzel
Copy link

Just for the record, the ChromiumOS Linux kernel, has the driver integrated in some of their Linux version branches – at least up to 5.15 – for example CHROMIUM: media: intel-ipu6: copy IPU6 driver from v5.4 branch and follow-up change-sets/commits.

@thepiwo
Copy link

thepiwo commented Aug 11, 2022

@Thesola10 have you managed building and getting the camera to run manually, if so with what steps?

@Thesola10

This comment was marked as outdated.

@Thesola10
Copy link

Thesola10 commented Aug 22, 2022

Update: Got a pure-DKMS version of the whole ipu6 driver stack working over on AUR: intel-ipu6-dkms-git

The resulting V4L2 device can't be used as-is, icamerasrc has to be used to get a picture (OV02C10 on Alder Lake)

(Of course, I have built an AUR package for that too: icamerasrc-git)

@paulmenzel
Copy link

Update: Got a pure-DKMS version of the whole ipu6 driver stack working over on AUR: intel-ipu6-dkms-git

Nice. What Linux versions are supported?

@Thesola10
Copy link

Likely everything that this repo supports, as long as CONFIG_KPROBES is enabled. I'm using the same workaround as @choff on anbox-modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants