Package: openrazer-driver-dkms
Version: 3.10.2+dfsg-1
Severity: important
Tags: trixie patch fixed-upstream
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.
-- System Information:
Debian Release: 13 (trixie)
Kernel: Linux 6.12.90+deb13.1-amd64 (SMP w/16 CPU threads)
Versions of packages openrazer-driver-dkms depends on:
dkms 3.2.2-1~deb13u1
Failing build kernel: linux-image-6.12.94+deb13-amd64 6.12.94-1