Skip to contentSkip to conversation

usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests

PATCH In review Julius Werner 2 participants 3 messages Mar 4, 2014 USB

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 usb: Make DELAY_INIT quirk wait 100ms between Get Configuration requests

The DELAY_INIT quirk only reduces the frequency of enumeration failures with the Logitech HD Pro C920 and C930e webcams, but does not quite eliminate them. We have found that adding a delay of 100ms between the first and second Get Configuration request makes the device enumerate perfectly reliable even after several weeks of extensive testing. The reasons for that are anyone's guess, but since the DELAY_INIT quirk already delays enumeration by a whole second, wating for another 10th of that isn't really a big deal for the one other device that uses it, and it will resolve the problems with these webcams.

Change-Id Ibf738426307fe8ef362768db2decc9bc2b30a930
---
 drivers/usb/core/config.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/core/config.c +4 -0
index 8d72f0c..062967c 100644
@@ -717,6 +717,10 @@ int usb_get_configuration(struct usb_device *dev)
 			result = -ENOMEM;
 			goto err;
 		}
+
+		if (dev->quirks & USB_QUIRK_DELAY_INIT)
+			msleep(100);
+
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
 		    bigbuffer, length);
 		if (result < 0) {
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 11 lines · Julius Werner

The DELAY_INIT quirk only reduces the frequency of enumeration failures with the Logitech HD Pro C920 and C930e webcams, but does not quite eliminate them. We have found that adding a delay of 100ms between the first and second Get Configuration request makes the device enumerate perfectly reliable even after several weeks of extensive testing. The reasons for that are anyone's guess, but since the DELAY_INIT quirk already delays enumeration by a whole second, wating for another 10th of that isn't really a big deal for the one other device that uses it, and it will resolve the problems with these webcams.

Change-Id: Ibf738426307fe8ef362768db2decc9bc2b30a930

What am I supposed to do with this line? :)

#2 lore raw
Quoted 2 lines

What am I supposed to do with this line? :)

Oh damn, sorry, forgot to take that out on the second one. We have this really annoying commit hook that adds them automatically. v2 incoming...