Skip to content

Commit 8dfd783

Browse files
Danilo Krummrichbwhacks
authored andcommitted
usb: quirks: add control message delay for 1b1c:1b20
commit cb88a05 upstream. Corsair Strafe RGB keyboard does not respond to usb control messages sometimes and hence generates timeouts. Commit de3af5b ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard") tried to fix those timeouts by adding USB_QUIRK_DELAY_INIT. Unfortunately, even with this quirk timeouts of usb_control_msg() can still be seen, but with a lower frequency (approx. 1 out of 15): [ 29.103520] usb 1-8: string descriptor 0 read error: -110 [ 34.363097] usb 1-8: can't set config #1, error -110 Adding further delays to different locations where usb control messages are issued just moves the timeouts to other locations, e.g.: [ 35.400533] usbhid 1-8:1.0: can't add hid device: -110 [ 35.401014] usbhid: probe of 1-8:1.0 failed with error -110 The only way to reliably avoid those issues is having a pause after each usb control message. In approx. 200 boot cycles no more timeouts were seen. Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary to have the delay in hub_port_connect() after hub_port_init(). The overall boot time seems not to be influenced by these additional delays, even on fast machines and lightweight distributions. Fixes: de3af5b ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard") Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
1 parent aa86975 commit 8dfd783

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

drivers/usb/core/message.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
150150

151151
ret = usb_internal_control_msg(dev, pipe, dr, data, size, timeout);
152152

153+
/* Linger a bit, prior to the next control message. */
154+
if (dev->quirks & USB_QUIRK_DELAY_CTRL_MSG)
155+
msleep(200);
156+
153157
kfree(dr);
154158

155159
return ret;

drivers/usb/core/quirks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ static const struct usb_device_id usb_quirk_list[] = {
210210
{ USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT },
211211

212212
/* Corsair Strafe RGB */
213-
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
213+
{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
214+
USB_QUIRK_DELAY_CTRL_MSG },
214215

215216
/* Corsair K70 LUX */
216217
{ USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },

include/linux/usb/quirks.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@
5050
*/
5151
#define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL BIT(11)
5252

53+
/* Device needs a pause after every control message. */
54+
#define USB_QUIRK_DELAY_CTRL_MSG BIT(13)
55+
5356
#endif /* __LINUX_USB_QUIRKS_H */

0 commit comments

Comments
 (0)