usb: gadget: uvc: rework pump worker to avoid while loop
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Mon, 11 Sep 2023 14:05:30 +0000 (16:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Oct 2023 11:58:35 +0000 (13:58 +0200)
commitbb00788bd62778ef80a97d67a0e3c569ac6be06f
treeea1da00afbef4b2834d19bcd6f85fcc594c77da2
parent52a39f2cf62bb5430ad1f54cd522dbfdab1d71ba
usb: gadget: uvc: rework pump worker to avoid while loop

The uvc_video_enable function is calling cancel_work_sync which will be
blocking as long as new requests will be queued with the while loop. To
ensure an earlier stop in the pumping loop in this particular case we
rework the worker to requeue itself on every requests. Since the worker
is already running prioritized, the scheduling overhad did not have real
impact on the performance.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20230911140530.2995138-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc_video.c