Skip to contentSkip to conversation

media: usb: uvc: Fix incorrect timeout for Get Request

PATCH Applied Jim Lin 2 participants 4 messages Jul 10, 2017 – Jul 14, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Jim Lin

author
#0 lore raw

PATCH v2 1/1 media: usb: uvc: Fix incorrect timeout for Get Request

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.

---
V2: Change patch description

 drivers/media/usb/uvc/uvcvideo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/uvc/uvcvideo.h +1 -1
index 15e415e..296b69b 100644
@@ -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 */
Signature · 1 line
2.7.4
maintainer Reviewed-by on v2 1/1
#1 lore raw

Hi Jim,

Thank you for the patch.

Quoted 9 lines · 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.

The patch looks good to me, so

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

Quoted 19 lines

---
V2: Change patch description

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

b/drivers/media/usb/uvc/uvcvideo.h index 15e415e..296b69b 100644

drivers/media/usb/uvc/uvcvideo.h +1 -1
@@ -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 */
Signature · 3 lines
Regards,

Laurent Pinchart
author
#2 lore raw
Quoted 13 lines · Laurent Pinchart

Hi Jim,

Thank you for the patch.

Quoted 8 lines · 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.

Quoted 8 lines
Quoted 1 line

The patch looks good to me, so

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

maintainer Applied
#4 lore raw
In reply to a message not in the archive

Hi Jim,

Quoted 26 lines · On Friday 14 Jul 2017 09:58:11 Jim Lin wrote:
Quoted 9 lines · Laurent Pinchart
Quoted 8 lines · 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.

Quoted 7 lines
Quoted 1 line

The patch looks good to me, so

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

Quoted 3 lines

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.

Signature · 3 lines
Regards,

Laurent Pinchart