usb: gadget: uvc: wake pump everytime we update the free list
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Wed, 16 Oct 2024 13:58:06 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 06:42:22 +0000 (08:42 +0200)
Since the req_free list will updated if enqueuing one request was not
possible it will be added back to the free list. With every available
free request in the queue it is a valid case for the pump worker to use
it and continue the pending bufferdata into requests for the req_ready
list.

Fixes: 6acba0345b68 ("usb:gadget:uvc Do not use worker thread to pump isoc usb requests")
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20240403-uvc_request_length_by_interval-v7-1-e224bb1035f0@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc_video.c

index 57a851151225dec1c478a8dee619f5c101a99671..002bf724d8025d4d589234df9d7f8a2251e305c5 100644 (file)
@@ -480,6 +480,10 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req)
                 * up later.
                 */
                list_add_tail(&to_queue->list, &video->req_free);
+               /*
+                * There is a new free request - wake up the pump.
+                */
+               queue_work(video->async_wq, &video->pump);
        }
 
        spin_unlock_irqrestore(&video->req_lock, flags);