Messages in this thread | | | Date | Fri, 5 Aug 2011 08:17:47 -0700 | From | Greg KH <> | Subject | Re: Staging: serqt_usb2: kmalloc(GFP_NOIO) with spinlock held in qt_break() and qt_tiocmset() |
| |
On Fri, Aug 05, 2011 at 06:35:10PM +0400, Alexey Khoroshilov wrote: > qt_break() calls usb_control_msg() with spinlock held,
Ick, not good, that will sleep.
> while usb_control_msg() calls kmalloc(GFP_NOIO) and indirectly usb_alloc_urb(GFP_NOIO).
You forgot the obvious call to wait_for_completion_timeout() in the usb_control_msg() callchain that shows that a spinlock is not a good thing to be using here :)
> The same is true for qt_tiocmget() and qt_tiocmset(). > > Is replacing spinlock with mutex an appropriate solution to fix the issue?
Yes, it sounds like it.
patches gladly accepted.
thanks,
greg k-h
| |