From 653a2c76e269628867632c7ce98fe2d75f3b13bb Mon Sep 17 00:00:00 2001 From: William Wu Date: Tue, 11 Mar 2025 15:32:36 +0800 Subject: [PATCH] HID: usbhid: Ignore set Led for USB Reader Some USB Readers base on the keyboard boot protocol, but they don't properly set the data toggle in the status stage when set the LED request. The known abnormal usb hid devices include: [1] idVendor=413d, idProduct=2107 [2] idVendor=ffff, idProduct=0035 This cause xHCI died on Rockchip platforms with the following typical log. [ 38.564579] usb 5-1: new full-speed USB device number 3 using xhci-hcd [ 38.707763] usb 5-1: New USB device found, idVendor=413d, idProduct=2107, bcdDevice= 0.00 [ 38.707829] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 38.707855] usb 5-1: Product: USB Reader [ 38.707880] usb 5-1: Manufacturer: DXTeco [ 38.707903] usb 5-1: SerialNumber: 2008-07-15 ...... [ 43.325848] usb 5-1: USB disconnect, device number 3 [ 48.481188] xhci-hcd xhci-hcd.1.auto: xHCI host not responding to stop endpoint command. [ 48.491454] xhci-hcd xhci-hcd.1.auto: xHCI host controller not responding, assume dead [ 48.491617] xhci-hcd xhci-hcd.1.auto: HC died; cleaning up In fact, the USB Readers don't support LED control, so it can ignore set Led for USB Readers to avoid xHCI died issue. Change-Id: Ie2cb6f8204055035d434f32dea548461c58c5ab1 Signed-off-by: William Wu --- drivers/hid/usbhid/hid-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index b0523b6d3821..84a167033ec3 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1185,7 +1185,10 @@ static int usbhid_start(struct hid_device *hid) if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD) { - usbhid_set_leds(hid); + if (dev->product && !strncasecmp(dev->product, "USB Reader", 10)) + dev_info(&hid->dev, "Ignore set Led for USB Reader\n"); + else + usbhid_set_leds(hid); device_set_wakeup_enable(&dev->dev, 1); }