linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: uvc: destroy worker when function is unbound
@ 2025-07-11  8:35 oushixiong1025
  2025-07-11 11:04 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: oushixiong1025 @ 2025-07-11  8:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michael Grzeschik, Sabyrzhan Tasbolatov, Frederic Weisbecker,
	linux-usb, linux-kernel, Xu Yang, Al Viro, Shixiong Ou

From: Shixiong Ou <oushixiong@kylinos.cn>

Destroy worker when function is unbound.

Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
---
 drivers/usb/gadget/function/f_uvc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index aa6ab666741a..e38477751894 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -992,6 +992,7 @@ static void uvc_function_unbind(struct usb_configuration *c,
 	uvcg_info(f, "%s()\n", __func__);
 
 	kthread_cancel_work_sync(&video->hw_submit);
+	kthread_destroy_worker(video->kworker);
 
 	if (video->async_wq)
 		destroy_workqueue(video->async_wq);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: uvc: destroy worker when function is unbound
  2025-07-11  8:35 [PATCH] usb: gadget: uvc: destroy worker when function is unbound oushixiong1025
@ 2025-07-11 11:04 ` Greg Kroah-Hartman
       [not found]   ` <d430ec08-70c0-4d2a-81aa-234e8f759cfc@163.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-07-11 11:04 UTC (permalink / raw)
  To: oushixiong1025
  Cc: Michael Grzeschik, Sabyrzhan Tasbolatov, Frederic Weisbecker,
	linux-usb, linux-kernel, Xu Yang, Al Viro, Shixiong Ou

On Fri, Jul 11, 2025 at 04:35:50PM +0800, oushixiong1025@163.com wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
> 
> Destroy worker when function is unbound.

This says what you did, but not why.

Why is this needed?  What happens without this change applied?

> 
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>

What commit id does this fix?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: uvc: destroy worker when function is unbound
       [not found]   ` <d430ec08-70c0-4d2a-81aa-234e8f759cfc@163.com>
@ 2025-07-11 15:30     ` Greg Kroah-Hartman
  2025-07-20 11:41       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-07-11 15:30 UTC (permalink / raw)
  To: oushixiong
  Cc: Michael Grzeschik, Sabyrzhan Tasbolatov, Frederic Weisbecker,
	linux-usb, linux-kernel, Xu Yang, Al Viro, Shixiong Ou

On Fri, Jul 11, 2025 at 11:29:36PM +0800, oushixiong wrote:
> 
> 在 2025/7/11 19:04, Greg Kroah-Hartman 写道:
> > On Fri, Jul 11, 2025 at 04:35:50PM +0800,oushixiong1025@163.com wrote:
> > > From: Shixiong Ou<oushixiong@kylinos.cn>
> > > 
> > > Destroy worker when function is unbound.
> > This says what you did, but not why.
> > 
> > Why is this needed?  What happens without this change applied?
> 
> I think the kthread_worker created in uvcg_video_init() is not being
> properly destroyed during the unbind phase.

Is this actually happening?  How was this noticed?  How was this tested?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: uvc: destroy worker when function is unbound
  2025-07-11 15:30     ` Greg Kroah-Hartman
@ 2025-07-20 11:41       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-07-20 11:41 UTC (permalink / raw)
  To: oushixiong
  Cc: Michael Grzeschik, Sabyrzhan Tasbolatov, Frederic Weisbecker,
	linux-usb, linux-kernel, Xu Yang, Al Viro, Shixiong Ou

On Fri, Jul 11, 2025 at 05:30:52PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Jul 11, 2025 at 11:29:36PM +0800, oushixiong wrote:
> > 
> > 在 2025/7/11 19:04, Greg Kroah-Hartman 写道:
> > > On Fri, Jul 11, 2025 at 04:35:50PM +0800,oushixiong1025@163.com wrote:
> > > > From: Shixiong Ou<oushixiong@kylinos.cn>
> > > > 
> > > > Destroy worker when function is unbound.
> > > This says what you did, but not why.
> > > 
> > > Why is this needed?  What happens without this change applied?
> > 
> > I think the kthread_worker created in uvcg_video_init() is not being
> > properly destroyed during the unbind phase.
> 
> Is this actually happening?  How was this noticed?  How was this tested?

Dropping from my review queue due to lack of response :(

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-20 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11  8:35 [PATCH] usb: gadget: uvc: destroy worker when function is unbound oushixiong1025
2025-07-11 11:04 ` Greg Kroah-Hartman
     [not found]   ` <d430ec08-70c0-4d2a-81aa-234e8f759cfc@163.com>
2025-07-11 15:30     ` Greg Kroah-Hartman
2025-07-20 11:41       ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).