Skip to content

Commit 46381fa

Browse files
committed
[FROM-ML] HID: usbhid: skip interrupt IN polling for devices with no input reports
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 4ac74ea ("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: 4ac74ea ("HID: asus: early return for ROG devices") Tested-by: Kerim Kabirov <the.privat33r+linux@pm.me> Tested-by: GameBurrow <gameburrow@pm.me> Signed-off-by: Ahmed Yaseen <yaseen@ghoul.dev>
1 parent 70e7f08 commit 46381fa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/hid/usbhid/hid-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ static int usbhid_open(struct hid_device *hid)
687687

688688
set_bit(HID_OPENED, &usbhid->iofl);
689689

690-
if (hid->quirks & HID_QUIRK_ALWAYS_POLL) {
690+
if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) ||
691+
list_empty(&hid->report_enum[HID_INPUT_REPORT].report_list)) {
691692
res = 0;
692693
goto Done;
693694
}

0 commit comments

Comments
 (0)