linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: Increase quirk delay for USB devices
@ 2017-09-05  8:40 Dmitry Fleytman
  2017-09-05 20:22 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Fleytman @ 2017-09-05  8:40 UTC (permalink / raw)
  Cc: Dmitry Fleytman, Greg Kroah-Hartman, Alan Stern, Samuel Thibault,
	Guenter Roeck, Mathias Nyman, Johan Hovold, Geert Uytterhoeven,
	Eugene Korenevsky, linux-usb, linux-kernel

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.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
---
 drivers/usb/core/config.c | 2 +-
 drivers/usb/core/hub.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 4be52c6..854c8d6 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -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);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 822f8c5..78c2aca 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: Increase quirk delay for USB devices
  2017-09-05  8:40 [PATCH] usb: Increase quirk delay for USB devices Dmitry Fleytman
@ 2017-09-05 20:22 ` Guenter Roeck
  2017-09-06 12:34   ` Dmitry Fleytman
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-09-05 20:22 UTC (permalink / raw)
  To: Dmitry Fleytman
  Cc: Greg Kroah-Hartman, Alan Stern, Samuel Thibault, Mathias Nyman,
	Johan Hovold, Geert Uytterhoeven, Eugene Korenevsky, linux-usb,
	linux-kernel

On Tue, Sep 05, 2017 at 11:40:56AM +0300, Dmitry Fleytman wrote:
> 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.
> 
> Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
> ---
>  drivers/usb/core/config.c | 2 +-
>  drivers/usb/core/hub.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
> index 4be52c6..854c8d6 100644
> --- a/drivers/usb/core/config.c
> +++ b/drivers/usb/core/config.c
> @@ -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

>  
>  		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
>  		    bigbuffer, length);
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 822f8c5..78c2aca 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -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
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: Increase quirk delay for USB devices
  2017-09-05 20:22 ` Guenter Roeck
@ 2017-09-06 12:34   ` Dmitry Fleytman
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Fleytman @ 2017-09-06 12:34 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Greg Kroah-Hartman, Alan Stern, Samuel Thibault, Mathias Nyman,
	Johan Hovold, Geert Uytterhoeven, Eugene Korenevsky, linux-usb,
	linux-kernel


> On 5 Sep 2017, at 23:22 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> 
> On Tue, Sep 05, 2017 at 11:40:56AM +0300, Dmitry Fleytman wrote:
>> 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.
>> 
>> Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
>> ---
>> drivers/usb/core/config.c | 2 +-
>> drivers/usb/core/hub.c    | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
>> index 4be52c6..854c8d6 100644
>> --- a/drivers/usb/core/config.c
>> +++ b/drivers/usb/core/config.c
>> @@ -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 ?

It was based in trial and error.

> 
> 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

> 
> Thanks,
> Guenter
> 
>> 
>> 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
>> 		    bigbuffer, length);
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 822f8c5..78c2aca 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -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
>> -- 
>> 2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-06 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05  8:40 [PATCH] usb: Increase quirk delay for USB devices Dmitry Fleytman
2017-09-05 20:22 ` Guenter Roeck
2017-09-06 12:34   ` Dmitry Fleytman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).