]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: MUSB: prevent recursive spinlock in TX path
authorKevin Hilman <khilman@mvista.com>
Wed, 20 Feb 2008 17:27:10 +0000 (09:27 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 5 Mar 2008 10:24:38 +0000 (12:24 +0200)
If a hard IRQ occurs during the soft IRQ TX processing, a recursive
spinlock BUG can occur.

Prevent this by interrupt-off locking around usb_hcd_link_urb_to_ep()

Found while testing bluetooth A2DP audio over USB.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/musb_host.c

index 2ad2ed95404aa23c039ef5fde6979a54ddebd357..82e12655dc8857620c23c0ccf9a6663522ff1a2e 100644 (file)
@@ -1757,7 +1757,9 @@ static int musb_urb_enqueue(
        if (!is_host_active(musb) || !musb->is_active)
                return -ENODEV;
 
+       spin_lock_irqsave(&musb->lock, flags);
        ret = usb_hcd_link_urb_to_ep(hcd, urb);
+       spin_unlock_irqrestore(&musb->lock, flags);
        if (ret)
                return ret;