summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-19 10:00:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-19 10:00:31 -0700
commita93f3bf4e1d60777b1659b812c9e818cfc53b449 (patch)
treeb72ace6a8daab0659264d38399cc618f01c0ec2b /scripts
parent7acf90feab8b009fde7def08ff2c622d0f10e99f (diff)
parentd89f04ac41e3b83a25b02c8d818ce09d7afc74c9 (diff)
Merge tag 'hid-for-linus-2026081901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Jiri Kosina: "Core: - fix long-standing force-feedback initialization race across the subsystem (Dmitry Torokhov) - switch to system_dfl_wq (Marco Crivellari) AMD-SFH: - support for tablet-mode switch for AMD SFH-based systems (Basavaraj Natikar) HyperX: - support for HyperX QuadCast 2 (Benjamin Blume) I2C-HID: - support for devices that provide HID descriptor solely through the ACPI _DSM method (XIE Zhibang) Intel-THC-HID: - support for full I2C bus config parameters (Even Xu) Logitech: - HID++ 2.0 repogrammable button support (Elliot Douglas) - Bolt receiver support for HID++ devices (Erik HÃ¥kansson) MSI: - support for MSI Claw (Derek J. Clark) Steam: - initial support for 2026 Steam Controller (Vicki Pfau) - support for sensor events on the 2025 Steam Controller (Vicki Pfau) And many, many other fixes for various long standing issues that were found by new modern tools, and quite a few device ID additions" * tag 'hid-for-linus-2026081901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (146 commits) HID: tmff: Use 64-bit arithmetic for force feedback scaling HID: multitouch: reclassify HTIX5288 to WIN_8_FORCE_MULTI_INPUT_NSMU HID: sensor: custom: Fix field sysfs group cleanup on failure HID: sensor: custom: Fix use-after-free in enable_sensor HID: intel-thc-hid: intel-quickspi: bound GET_REPORT response to the caller buffer HID: haptic: don't write an uninitialized value to unhandled usages HID: intel-thc-hid: intel-quickspi: fix autosuspend cleanup during teardown HID: intel-thc-hid: intel-quicki2c: fix autosuspend cleanup during teardown HID: steam: Zero out inputs when disabling gamepad mode HID: steam: Clean up locking HID: steam: Don't set feature reports when disconnecting HID: steam: Fix wording of connect/disconnect logs HID: steam: Initial 2026 Steam Controller support HID: steam: Refactor registration HID: logitech: add Bolt receiver support for Logitech HID++ devices HID: sensor-hub: Fix out-of-bounds write in sensor_hub_get_feature HID: universal-pidff: stop the device when force-feedback init fails HID: haptic: move FF initialization into .input_configured() HID: logitech-hidpp: move FF initialization to .input_configured() HID: megaworld: move FF initialization to .input_configured() ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/hid/ff_race.cocci34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/coccinelle/hid/ff_race.cocci b/scripts/coccinelle/hid/ff_race.cocci
new file mode 100644
index 000000000000..479f5d1e3184
--- /dev/null
+++ b/scripts/coccinelle/hid/ff_race.cocci
@@ -0,0 +1,34 @@
+/// Detect HID drivers that initialize force-feedback after hid_hw_start()
+/// when HID_CONNECT_HIDINPUT is used. This is a lifecycle violation as
+/// the input device is already registered.
+//
+// Confidence: High
+// Copyright: (C) 2026 Gemini. GPLv2.
+
+virtual report
+
+@r@
+identifier probe_fn;
+expression hdev, flags;
+position p1, p2;
+@@
+
+probe_fn(struct hid_device *hdev, ...) {
+ <...
+ hid_hw_start@p1(hdev, flags)
+ ...
+ \(input_ff_create\|input_ff_create_memless\)@p2(...)
+ ...>
+}
+
+@script:python depends on report@
+p1 << r.p1;
+p2 << r.p2;
+flags << r.flags;
+@@
+
+# Check if flags include HID_CONNECT_HIDINPUT (0x01) or HID_CONNECT_DEFAULT (0x0f)
+# Note: HID_CONNECT_DEFAULT is 0x0f, HID_CONNECT_HIDINPUT is 0x01
+if "HID_CONNECT_HIDINPUT" in flags or "HID_CONNECT_DEFAULT" in flags:
+ msg = "WARNING: force-feedback initialized after hid_hw_start() with HID_CONNECT_HIDINPUT. Input device is already registered at this point. Use .input_configured() instead."
+ coccilib.report.print_report(p2[0], msg)