[PATCH] ARM: OMAP: MUSB: prevent recursive spinlock in TX path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 drivers/usb/musb/musb_host.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 2ad2ed9..82e1265 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -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;
 
-- 
1.5.4.1.9.g9c55

-
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux