Commit aabd368e authored by Jayant Chowdhary's avatar Jayant Chowdhary Committed by Avichal Rakesh
Browse files

FROMGIT: usb:gadget:uvc Do not use worker thread to pump isoc usb requests



When we use an async work queue to perform the function of pumping
usb requests to the usb controller, it is possible that amongst other
factors, thread scheduling affects at what cadence we're able to pump
requests. This could mean isoc usb requests miss their uframes - resulting
in video stream flickers on the host device.

To avoid this, we make the async_wq thread only produce isoc usb_requests
with uvc buffers encoded into them. The process of queueing to the
endpoint is done by the uvc_video_complete() handler. In case no
usb_requests are ready with encoded information, we just queue a zero
length request to the endpoint from the complete handler.

For bulk endpoints the async_wq thread still queues usb requests to the
endpoint.

Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
Suggested-by: default avatarAvichal Rakesh <arakesh@google.com>
Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20231120062026.3759463-1-jchowdhary@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 314030607
Bug: 301915972
(cherry picked from commit 6acba034
 https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb

 usb-next)
Signed-off-by: default avatarAvichal Rakesh <arakesh@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:60a94adfc6f570cb801afc51aebc78d5fb83e0f2)
Merged-In: I5597cc29e9caec69e4f3575938d7d640857aaa28
Change-Id: I5597cc29e9caec69e4f3575938d7d640857aaa28
parent 3d415081
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment