Skip to contentSkip to conversation

usb: Increase quirk delay for USB devices

PATCH In review Dmitry Fleytman 2 participants 3 messages Sep 5, 2017 – Sep 6, 2017 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: Increase quirk delay for USB devices

Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e") introduced quirk to workaround an issue with some Logitech webcams.

The workaround is introducing delay for some USB operations.

According to our testing, delay introduced by original commit is not long enough and in rare cases we still see issues described by the aforementioned commit.

This patch increases delays introduced by original commit. Having this patch applied we do not see those problems anymore.

---
 drivers/usb/core/config.c | 2 +-
 drivers/usb/core/hub.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/config.c +1 -1
index 4be52c6..854c8d6 100644
@@ -852,7 +852,7 @@ int usb_get_configuration(struct usb_device *dev)
 		}
 
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(100);
+			msleep(200);
 
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
 		    bigbuffer, length);
drivers/usb/core/hub.c +1 -1
index 822f8c5..78c2aca 100644
@@ -4825,7 +4825,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
 			goto loop;
 
 		if (udev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(1000);
+			msleep(2000);
 
 		/* consecutive bus-powered hubs aren't reliable; they can
 		 * violate the voltage drop budget.  if the new child has
Signature · 1 line
2.7.4
#1 lore raw
Quoted 24 lines · Dmitry Fleytman

Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e") introduced quirk to workaround an issue with some Logitech webcams.

The workaround is introducing delay for some USB operations.

According to our testing, delay introduced by original commit is not long enough and in rare cases we still see issues described by the aforementioned commit.

This patch increases delays introduced by original commit. Having this patch applied we do not see those problems anymore.

---
 drivers/usb/core/config.c | 2 +-
 drivers/usb/core/hub.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/config.c +0 -0
index 4be52c6..854c8d6 100644

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 855

Quoted 5 lines
drivers/usb/core/config.c +1 -1
@@ -852,7 +852,7 @@ int usb_get_configuration(struct usb_device *dev)
 		}
 
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(100);
+			msleep(200);

How did you determine the new delays ? Was it discussed with the vendor, or is it based on trial and error ?

Either case, did you confirm that you need to increase both delays for the problem to disappear ?

Thanks,
Guenter

Quoted 19 lines
drivers/usb/core/config.c +0 -0
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
 		    bigbuffer, length);
drivers/usb/core/hub.c +1 -1
index 822f8c5..78c2aca 100644
@@ -4825,7 +4825,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
 			goto loop;
 
 		if (udev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(1000);
+			msleep(2000);
 
 		/* consecutive bus-powered hubs aren't reliable; they can
 		 * violate the voltage drop budget.  if the new child has
Signature · 1 line
2.7.4
#2 lore raw
Quoted 30 lines · Guenter Roeck
Quoted 26 lines · Dmitry Fleytman

Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e") introduced quirk to workaround an issue with some Logitech webcams.

The workaround is introducing delay for some USB operations.

According to our testing, delay introduced by original commit is not long enough and in rare cases we still see issues described by the aforementioned commit.

This patch increases delays introduced by original commit. Having this patch applied we do not see those problems anymore.

---
drivers/usb/core/config.c | 2 +-
drivers/usb/core/hub.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/config.c +0 -0
index 4be52c6..854c8d6 100644
@@ -852,7 +852,7 @@ int usb_get_configuration(struct usb_device *dev)
 		}
 
Quoted 6 lines

drivers/usb/core/config.c int usb_get_configuration(struct usb_device *dev) · line 855

Quoted 3 lines
drivers/usb/core/config.c +1 -1
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(100);
+			msleep(200);

How did you determine the new delays ? Was it discussed with the vendor, or is it based on trial and error ?

It was based in trial and error.

Quoted 3 lines

Either case, did you confirm that you need to increase both delays for the problem to disappear ?

Yes, according to testing results on our setups.

Thanks,
Dmitry

Quoted 22 lines

Thanks,
Guenter

Quoted 18 lines
drivers/usb/core/config.c +0 -0
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
 		    bigbuffer, length);
drivers/usb/core/hub.c +1 -1
index 822f8c5..78c2aca 100644
@@ -4825,7 +4825,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
 			goto loop;
 
 		if (udev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(1000);
+			msleep(2000);
 
 		/* consecutive bus-powered hubs aren't reliable; they can
 		 * violate the voltage drop budget.  if the new child has
Signature · 1 line
2.7.4