#1140491 openrazer-driver-dkms: FTBFS against trixie kernel 6.12.94 (hid_report_raw_event gained bufsize arg) #1140491
- Package:
- openrazer-driver-dkms
- Source:
- openrazer-driver-dkms
- Submitter:
- Date:
- 2026-08-02 21:49:01 UTC
- Severity:
- normal
- Tags:
Dear Maintainer,
openrazer-driver-dkms 3.10.2+dfsg-1 (the version in trixie) fails to build
against the kernel that trixie itself now ships, linux-image-6.12.94+deb13-amd64
(6.12.94-1). The 6.12.94 point release changed the in-kernel HID API:
hid_report_raw_event() gained a new "size_t bufsize" parameter, so it now takes
six arguments:
int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type,
u8 *data, size_t bufsize, u32 size, int interrupt);
razerkbd_driver.c still calls it with the old five-argument signature, so the
DKMS autobuild fails:
driver/razerkbd_driver.c: In function 'razer_raw_event_bitfield':
driver/razerkbd_driver.c:3729:29: error: too few arguments to function
'hid_report_raw_event'
3729 | hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), 0);
| ^~~~~~~~~~~~~~~~~~~~
.../include/linux/hid.h:1218:5: note: declared here
driver/razerkbd_driver.c:3733:29: error: too few arguments ... (same)
make[3]: *** [.../razerkbd_driver.o] Error 1
Impact: because this is a DKMS module, the failed build aborts the kernel
package's postinst (run-parts /etc/kernel/postinst.d/dkms exits non-zero),
which leaves linux-image-6.12.94+deb13-amd64 and its dependents
(linux-headers-*, linux-image-amd64) in a half-configured state. So this does
not merely disable the Razer modules -- it breaks the stable kernel upgrade
itself for every trixie user who has openrazer-driver-dkms installed and pulls
the 6.12.94 update. This is a regression introduced by a trixie stable kernel
update, so it would be good to fix in a trixie point release / via
proposed-updates.
sid/unstable is not affected: openrazer 3.12.3+dfsg-1 already builds (cf. #1138777,
fixed upstream). Only the stable (trixie) 3.10.2 version needs the backported fix.
A minimal, version-guarded patch follows. It is guarded on LINUX_VERSION_CODE so
the same source still builds against the older trixie kernels (6.12.90), which a
user may still have installed when 6.12.94 arrives; passing sizeof(xdata) as both
bufsize and size is correct here (the buffer is exactly the report size). The
maintainer may of course prefer to lift the corresponding hunk from the upstream
3.12.x fix instead.
--- a/driver/razerkbd_driver.c
+++ b/driver/razerkbd_driver.c
@@ -10,6 +10,7 @@
#include <linux/usb/input.h>
#include <linux/hid.h>
#include <linux/dmi.h>
+#include <linux/version.h>
#include <linux/input-event-codes.h>
#include "usb_hid_keys.h"
@@ -3726,7 +3727,11 @@
// report key down
xdata[1] = cur_value;
- hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), 0);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 94)
+ hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), sizeof(xdata), 0);
+#else
+ hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), 0);
+#endif
// report key up
xdata[1] = 0x00;
@@ -3730,7 +3735,11 @@
// report key up
xdata[1] = 0x00;
- hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), 0);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 94)
+ hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), sizeof(xdata), 0);
+#else
+ hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata, sizeof(xdata), 0);
+#endif
}
}
}
With the patch applied the module builds and loads cleanly on
6.12.94+deb13-amd64.
Hi,
This bug also affects bookworm. The latest bookworm kernel update
(linux-image-6.1.0-50-amd64, version 6.1.176-1) backported the same
API change: hid_report_raw_event() gained a size_t bufsize parameter.
As a result, openrazer-driver-dkms 3.5.1+dfsg-2+deb12u1 fails to build
during the kernel's postinst, which leaves linux-image-6.1.0-50-amd64,
linux-image-amd64, linux-headers-6.1.0-50-amd64 and linux-headers-amd64
unconfigured, and every subsequent "apt upgrade" fails with:
/var/lib/dkms/openrazer-driver/3.5.1/build/driver/razerkbd_driver.c:3124:29:
error: too few arguments to function 'hid_report_raw_event'
3124 | hid_report_raw_event(hdev, HID_INPUT_REPORT, xdata,
sizeof(xdata), 0);
In file included from razerkbd_driver.c:11:
/usr/src/linux-headers-6.1.0-50-common/include/linux/hid.h:1191:5: note:
declared here
1191 | int hid_report_raw_event(struct hid_device *hid, enum
hid_report_type type, u8 *data,
| size_t bufsize, u32 size, int interrupt);
dkms: autoinstall for kernel: 6.1.0-50-amd64 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.1.0-50-amd64 (--configure)
The same fix as for trixie works: passing the buffer size as the new
4th argument in the two calls in driver/razerkbd_driver.c (lines 3124
and 3128 in the 3.5.1 source):
--- a/driver/razerkbd_driver.c
+++ b/driver/razerkbd_driver.c
@@ -3121,11 +3121,11 @@
// report key down
xdata[1] = cur_value;
- hid_report_raw_event(hdev, HID_INPUT_REPORT,
xdata, sizeof(xdata), 0);
+ hid_report_raw_event(hdev, HID_INPUT_REPORT,
xdata, sizeof(xdata), sizeof(xdata), 0);
// report key up
xdata[1] = 0x00;
- hid_report_raw_event(hdev, HID_INPUT_REPORT,
xdata, sizeof(xdata), 0);
+ hid_report_raw_event(hdev, HID_INPUT_REPORT,
xdata, sizeof(xdata), sizeof(xdata), 0);
}
With this change the DKMS module builds and the four modules (razerkbd,
razermouse, razerkraken, razeraccessory) install fine on 6.1.0-50-amd64.
For a proper stable update this would need the same LINUX_VERSION_CODE
guard as proposed for trixie, adjusted to KERNEL_VERSION(6, 1, 176),
so the package still builds against older bookworm kernels.
Since this breaks kernel upgrades on stable for anyone with openrazer
installed, it would be great to see this fixed in a bookworm point
release.
System: Debian 12 (bookworm), kernel 6.1.0-50-amd64 (6.1.176-1),
openrazer-driver-dkms 3.5.1+dfsg-2+deb12u1.
Regards,
Oleg