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 <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2025-03-11 15:32:36 +08:00
committed by Tao Huang
parent fc025fe10d
commit 653a2c76e2

View File

@@ -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);
}