#1149259 v4l2loopback-dkms: FTBFS against kernel >= 6.18 (v4l2_fh_add signature, HAVE_TIMER_SETUP guard)

#1149259#5
Date:
2026-09-28 20:23:39 UTC
From:
To:
Dear Maintainer,

v4l2loopback-dkms 0.15.0-2 fails to build against any kernel >= 6.18, which
includes the 7.1.x kernels currently in trixie-backports. The module is
therefore unusable for anyone running a backports kernel on trixie. It
builds
fine against trixie's own 6.12 kernel, hence "important" rather than
"serious".

Build failure
-------------

  $ make -C /lib/modules/7.1.13+deb13-amd64/build M=$PWD modules

  v4l2loopback.c:2337:9: error: too few arguments to function 'v4l2_fh_add'
  v4l2loopback.c:2386:9: error: too few arguments to function 'v4l2_fh_del'
  v4l2loopback.c:2904:9: error: implicit declaration of function
'setup_timer'
                         [-Wimplicit-function-declaration]

Two independent causes
----------------------

1. v4l2_fh_add() and v4l2_fh_del() gained a "struct file *filp" parameter.
   In include/media/v4l2-fh.h of 7.1.13:

     void v4l2_fh_add(struct v4l2_fh *fh, struct file *filp);
     void v4l2_fh_del(struct v4l2_fh *fh, struct file *filp);

   0.15.0 still calls them with one argument (lines 2337 and 2386).

2. The HAVE_TIMER_SETUP guard no longer matches. 0.15.0 has:

     #if defined(timer_setup) && defined(from_timer)
     #define HAVE_TIMER_SETUP
     #endif

   from_timer() has been removed from the kernel, so HAVE_TIMER_SETUP is not
   defined and the code falls back to setup_timer(), itself removed back in
   4.15. This is what produces the third error.

Both are fixed upstream in 0.15.4
---------------------------------

Upstream added a compatibility shim for the first:

     #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 18, 0)
     #define v4l2_fh_add(fh, filp) v4l2_fh_add(fh)
     #define v4l2_fh_del(fh, filp) v4l2_fh_del(fh)
     #endif

   with call sites updated to v4l2_fh_add(&opener->fh, file).

and relaxed the guard for the second:

     #if defined(timer_setup)
     #define HAVE_TIMER_SETUP
     #endif

I verified that upstream 0.15.4 builds cleanly against 7.1.13+deb13-amd64
with no warnings, and the resulting module works: it is what I am currently
running as a DKMS module in place of the packaged one.

Suggested fix: update the package to 0.15.4. Alternatively the two hunks
above
are small enough to cherry-pick.

Steps to reproduce
------------------

  1. Install a trixie-backports kernel and its headers (7.1.x).
  2. apt install v4l2loopback-dkms
  3. The DKMS build fails; no module is produced for that kernel.