All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request
@ 2017-07-10  6:43 Jim Lin
  2017-07-10 19:47 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Lin @ 2017-07-10  6:43 UTC (permalink / raw)
  To: laurent.pinchart, mchehab; +Cc: linux-kernel, linux-media, Jim Lin

Section 9.2.6.4 of USB 2.0/3.x specification describes that
"device must be able to return the first data packet to host within
500 ms of receipt of the request. For subsequent data packet, if any,
the device must be able to return them within 500 ms".

This is to fix incorrect timeout and change it from 300 ms to 500 ms
to meet the timing specified by specification for Get Request.

Signed-off-by: Jim Lin <jilin@nvidia.com>
---
V2: Change patch description

 drivers/media/usb/uvc/uvcvideo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 15e415e..296b69b 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -166,7 +166,7 @@
 /* Maximum status buffer size in bytes of interrupt URB. */
 #define UVC_MAX_STATUS_SIZE	16
 
-#define UVC_CTRL_CONTROL_TIMEOUT	300
+#define UVC_CTRL_CONTROL_TIMEOUT	500
 #define UVC_CTRL_STREAMING_TIMEOUT	5000
 
 /* Maximum allowed number of control mappings per device */
-- 
2.7.4

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

* Re: [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request
  2017-07-10  6:43 [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request Jim Lin
@ 2017-07-10 19:47 ` Laurent Pinchart
  2017-07-14  2:11   ` Jim Lin
       [not found]   ` <3a7d73bb-45f8-4803-ee9b-8bf2ead84017@nvidia.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Laurent Pinchart @ 2017-07-10 19:47 UTC (permalink / raw)
  To: Jim Lin; +Cc: mchehab, linux-kernel, linux-media

Hi Jim,

Thank you for the patch.

On Monday 10 Jul 2017 14:43:49 Jim Lin wrote:
> Section 9.2.6.4 of USB 2.0/3.x specification describes that
> "device must be able to return the first data packet to host within
> 500 ms of receipt of the request. For subsequent data packet, if any,
> the device must be able to return them within 500 ms".
> 
> This is to fix incorrect timeout and change it from 300 ms to 500 ms
> to meet the timing specified by specification for Get Request.
> 
> Signed-off-by: Jim Lin <jilin@nvidia.com>

The patch looks good to me, so

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

but I'm curious, have you noticed issues with some devices in practice ?

> ---
> V2: Change patch description
> 
>  drivers/media/usb/uvc/uvcvideo.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvcvideo.h
> b/drivers/media/usb/uvc/uvcvideo.h index 15e415e..296b69b 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -166,7 +166,7 @@
>  /* Maximum status buffer size in bytes of interrupt URB. */
>  #define UVC_MAX_STATUS_SIZE	16
> 
> -#define UVC_CTRL_CONTROL_TIMEOUT	300
> +#define UVC_CTRL_CONTROL_TIMEOUT	500
>  #define UVC_CTRL_STREAMING_TIMEOUT	5000
> 
>  /* Maximum allowed number of control mappings per device */

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request
  2017-07-10 19:47 ` Laurent Pinchart
@ 2017-07-14  2:11   ` Jim Lin
       [not found]   ` <3a7d73bb-45f8-4803-ee9b-8bf2ead84017@nvidia.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Lin @ 2017-07-14  2:11 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: mchehab, linux-kernel, linux-media

On 2017年07月11日 03:47, Laurent Pinchart wrote:
> Hi Jim,
>
> Thank you for the patch.
>
> On Monday 10 Jul 2017 14:43:49 Jim Lin wrote:
>> Section 9.2.6.4 of USB 2.0/3.x specification describes that
>> "device must be able to return the first data packet to host within
>> 500 ms of receipt of the request. For subsequent data packet, if any,
>> the device must be able to return them within 500 ms".
>>
>> This is to fix incorrect timeout and change it from 300 ms to 500 ms
>> to meet the timing specified by specification for Get Request.
>>
>> Signed-off-by: Jim Lin <jilin@nvidia.com>
>
> The patch looks good to me, so
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> but I'm curious, have you noticed issues with some devices in practice ?
>

Sometimes this device takes about 360 ms to respond.

usb 1-2: new high-speed USB device number 16
usb 1-2: New USB device found, idVendor=045e, idProduct=0772
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: Microsoft�® LifeCam Studio(TM)
usb 1-2: Manufacturer: Microsoft
:
uvcvideo: Failed to query (GET_DEF) UVC control 2 on unit 4: -110 (exp. 2).

And it will be working well with correct timeout value.

--nvpublic

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

* Re: [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request
       [not found]   ` <3a7d73bb-45f8-4803-ee9b-8bf2ead84017@nvidia.com>
@ 2017-07-14  7:34     ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2017-07-14  7:34 UTC (permalink / raw)
  To: Jim Lin; +Cc: mchehab, linux-kernel, linux-media

Hi Jim,

On Friday 14 Jul 2017 09:58:11 Jim Lin wrote:
> On 2017年07月11日 03:47, Laurent Pinchart wrote:
> > On Monday 10 Jul 2017 14:43:49 Jim Lin wrote:
> >> Section 9.2.6.4 of USB 2.0/3.x specification describes that
> >> "device must be able to return the first data packet to host within
> >> 500 ms of receipt of the request. For subsequent data packet, if any,
> >> the device must be able to return them within 500 ms".
> >> 
> >> This is to fix incorrect timeout and change it from 300 ms to 500 ms
> >> to meet the timing specified by specification for Get Request.
> >> 
> >> Signed-off-by: Jim Lin <jilin@nvidia.com>
> > 
> > The patch looks good to me, so
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > but I'm curious, have you noticed issues with some devices in practice ?
> 
> Sometimes this device takes about 360 ms to respond.
> 
> usb 1-2: new high-speed USB device number 16
> usb 1-2: New USB device found, idVendor=045e, idProduct=0772
> usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> usb 1-2: Product: Microsoft�® LifeCam Studio(TM)
> usb 1-2: Manufacturer: Microsoft
> 
> uvcvideo: Failed to query (GET_DEF) UVC control 2 on unit 4: -110 (exp. 2).
> 
> And it will be working well with correct timeout value.

Thank you for the information.

I've applied the patch to my tree and will push it to v4.14.

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2017-07-14  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10  6:43 [PATCH 1/1 V2] media: usb: uvc: Fix incorrect timeout for Get Request Jim Lin
2017-07-10 19:47 ` Laurent Pinchart
2017-07-14  2:11   ` Jim Lin
     [not found]   ` <3a7d73bb-45f8-4803-ee9b-8bf2ead84017@nvidia.com>
2017-07-14  7:34     ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.