Skip to content

Commit e5644be

Browse files
Frederic Weisbeckergregkh
authored andcommitted
usb: gadget: uvc: Fix unstarted kthread worker
The behaviour of kthread_create_worker() was recently changed to align with the one of kthread_create(). The kthread worker is created but not awaken by default. This is to allow the use of kthread_affine_preferred() and kthread_bind[_mask]() with kthread workers. In order to keep the old behaviour and wake the kthread up, kthread_run_worker() must be used. All the pre-existing users have been converted, except for UVC that was introduced in the same merge window as the API change. This results in hangs: INFO: task UVCG:82 blocked for more than 491 seconds. Tainted: G T 6.13.0-rc2-00014-gb04e317b5226 #1 task:UVCG state:D stack:0 pid:82 Call Trace: __schedule schedule schedule_preempt_disabled kthread ? kthread_flush_work ret_from_fork ret_from_fork_asm entry_INT80_32 Fix this with converting UVCG kworker to the new API. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Fixes: f0bbfbd ("usb: gadget: uvc: rework to enqueue in pump worker from encoded queue") Cc: stable <[email protected]> Cc: Michael Grzeschik <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e169d96 commit e5644be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/function/uvc_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ int uvcg_video_init(struct uvc_video *video, struct uvc_device *uvc)
818818
return -EINVAL;
819819

820820
/* Allocate a kthread for asynchronous hw submit handler. */
821-
video->kworker = kthread_create_worker(0, "UVCG");
821+
video->kworker = kthread_run_worker(0, "UVCG");
822822
if (IS_ERR(video->kworker)) {
823823
uvcg_err(&video->uvc->func, "failed to create UVCG kworker\n");
824824
return PTR_ERR(video->kworker);

0 commit comments

Comments
 (0)