]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: ti serial driver sleeps with spinlock held
authorOliver Neukum <oneukum@suse.de>
Mon, 7 May 2007 06:33:18 +0000 (08:33 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 26 Jun 2007 06:38:05 +0000 (23:38 -0700)
you are submitting an URB with GFP_KERNEL holding a spinlock.
In this case the spinlock can be dropped earlier.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/ti_usb_3410_5052.c

index 4203e2b1a761681d0221fc1cf46e5a910d9866b5..3d505fd0645b04e5740c1f597ef827b57ac68666 100644 (file)
@@ -1555,15 +1555,17 @@ static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty)
        spin_lock_irqsave(&tport->tp_lock, flags);
 
        if (tport->tp_read_urb_state == TI_READ_URB_STOPPED) {
+               tport->tp_read_urb_state = TI_READ_URB_RUNNING;
                urb = tport->tp_port->read_urb;
+               spin_unlock_irqrestore(&tport->tp_lock, flags);
                urb->complete = ti_bulk_in_callback;
                urb->context = tport;
                urb->dev = tport->tp_port->serial->dev;
                status = usb_submit_urb(urb, GFP_KERNEL);
+       } else  {
+               tport->tp_read_urb_state = TI_READ_URB_RUNNING;
+               spin_unlock_irqrestore(&tport->tp_lock, flags);
        }
-       tport->tp_read_urb_state = TI_READ_URB_RUNNING;
-
-       spin_unlock_irqrestore(&tport->tp_lock, flags);
 
        return status;
 }