usb: gadget: uvc: queue pump work in uvcg_video_enable()
Subsystems (3)
PATCH 1/1 usb: gadget: uvc: queue pump work in uvcg_video_enable()
Since commit "6acba0345b68 usb:gadget:uvc Do not use worker thread to pump isoc usb requests", pump work could only be queued in uvc_video_complete() and uvc_v4l2_qbuf(). If VIDIOC_QBUF is executed before VIDIOC_STREAMON, we can only depend on uvc_video_complete() to queue pump work. However, this requires some free requests in req_ready list. If req_ready list is empty all the time, pump work will never be queued and video datas will never be pumped to usb controller. Actually, this situation could happen when run uvc-gadget with static image:
$ ./uvc-gadget -i 1080p.jpg uvc.0
When capture image from this device, the user app will always block there.
The issue is uvc driver has queued video buffer before streamon, but the req_ready list is empty all the time after streamon. This will queue pump work in uvcg_video_enable() to fill some request to req_ready list so the uvc device could work properly.
--- drivers/usb/gadget/function/uvc_video.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/function/uvc_video.c +1 -0
@@ -753,6 +753,7 @@ int uvcg_video_enable(struct uvc_video *video) video->req_int_count =0 ;uvc_video_ep_queue_initial_requests (video); +queue_work (video->async_wq, &video->pump);return ret; }
Signature · 1 line
2.34.1
Greg KH
maintainerQuoted 40 lines · Xu Yang
Since commit "
6acba0345b68usb:gadget:uvc Do not use worker thread to pump isoc usb requests", pump work could only be queued inuvc_video_complete()anduvc_v4l2_qbuf(). IfVIDIOC_QBUFis executed beforeVIDIOC_STREAMON, we can only depend onuvc_video_complete()to queue pump work. However, this requires some free requests inreq_readylist. Ifreq_readylist is empty all the time, pump work will never be queued and video datas will never be pumped to usb controller. Actually, this situation could happen when run uvc-gadget with static image:$ ./uvc-gadget -i 1080p.jpg uvc.0When capture image from this device, the user app will always block there.
The issue is uvc driver has queued video buffer before streamon, but the
req_readylist is empty all the time after streamon. This will queue pump work inuvcg_video_enable()to fill some request toreq_readylist so the uvc device could work properly.Fixes 6acba0345b68 ("usb:gadget:uvc Do not use worker thread to pump isoc usb requests")Signed-off-by Xu Yang <[email protected]>--- drivers/usb/gadget/function/uvc_video.c | 1 + 1 file changed, 1 insertion(+)drivers/usb/gadget/function/uvc_video.c +1
-0@@ -753,6 +753,7 @@ int uvcg_video_enable(struct uvc_video *video) video->req_int_count =0 ;uvc_video_ep_queue_initial_requests (video); +queue_work (video->async_wq, &video->pump);return ret; }Signature · 1 line
2.34.1
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- Your patch was sent privately to Greg. Kernel development is done in public, please always cc: a public mailing list with a patch submission. Using the tool, scripts/get_maintainer.pl on the patch will tell you what mailing list to cc.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot