]> git.hungrycats.org Git - linux/commitdiff
HID: usbhid: skip interrupt IN polling for devices with no input reports
authorAhmed Yaseen <yaseen@ghoul.dev>
Fri, 28 Aug 2026 10:42:21 +0000 (10:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:10:49 +0000 (12:10 -0500)
commit 4563e596bd913fb2d5b10b2ef306c754cf97ced2 upstream.

usbhid starts polling a device's interrupt IN endpoint on open
(usbhid_open() -> hid_start_in()). If the report descriptor declares no
input reports there is nothing to read there, so the poll is useless,
and on some composite devices it is also harmful.

The ASUS ROG N-Key keyboards expose a second, input-less interface used
only for RGB control via feature reports. Opening its hidraw node (any
hidraw reader does, including SDL/Steam Input or a plain cat) starts the
pointless IN poll and keypress reports on the keyboard interface get
dropped for as long as the node stays open: a lost key-down drops a
letter, a lost key-up leaves the key stuck. usbmon shows the dropped
reports never reach the URB layer.

The useless poll itself is long-standing; commit 4ac74ea68f64 ("HID:
asus: early return for ROG devices") is what exposes it on these
devices by keeping the input-less interface alive instead of ejecting
it, so its hidraw node can be opened and the poll started.

Skip the poll in usbhid_open() when the device has no input reports.
Feature reports and hidraw output keep working over the control and OUT
endpoints, so the interface is otherwise unaffected.

Fixes: 4ac74ea68f64 ("HID: asus: early return for ROG devices")
Link: https://discuss.cachyos.org/t/keyboard-input-issues-on-asus-rog-strix-16-2025-with-cachyos-during-gaming/30823
Link: https://github.com/ublue-os/bazzite/issues/4590
Cc: stable@vger.kernel.org
Tested-by: Kerim Kabirov <the.privat33r+linux@pm.me>
Tested-by: GameBurrow <gameburrow@pm.me>
Signed-off-by: Ahmed Yaseen <yaseen@ghoul.dev>
Reviewed-by: Denis Benato <denis.benato@linux.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/usbhid/hid-core.c

index 96b0181cf8194fd6a90a2af3edc434d92b7ca5ea..d7cf2b56e117741d61dbddd80da877805b0500c9 100644 (file)
@@ -688,7 +688,14 @@ static int usbhid_open(struct hid_device *hid)
 
        set_bit(HID_OPENED, &usbhid->iofl);
 
-       if (hid->quirks & HID_QUIRK_ALWAYS_POLL) {
+       /*
+        * ALWAYS_POLL devices are already polled from usbhid_start(), and a
+        * device with no input reports has nothing to send on the interrupt
+        * IN endpoint. In some cases polling is harmful: on the ASUS ROG
+        * N-Key keyboards it makes the sibling interface drop keypresses.
+        */
+       if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) ||
+           list_empty(&hid->report_enum[HID_INPUT_REPORT].report_list)) {
                res = 0;
                goto Done;
        }