lkml.org 
[lkml]   [2011]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: 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


    \
     
     \ /
      Last update: 2011-08-05 17:21    [W:0.019 / U:0.016 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site