public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: MUSB: DMA interrupt locking fix
@ 2007-08-31 23:31 Kevin Hilman
  2007-09-01  2:15 ` David Brownell
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2007-08-31 23:31 UTC (permalink / raw)
  To: linux-omap-open-source

dma_controller_irq() should take the lock (and disable interrupts) as
the main interrupt handler does since the functions it calls assume
this to be the case.

Signed-off-by: Kevin Hilman <khilman@mvista.com>

Index: dev/drivers/usb/musb/musbhsdma.c
===================================================================
--- dev.orig/drivers/usb/musb/musbhsdma.c
+++ dev/drivers/usb/musb/musbhsdma.c
@@ -296,6 +296,7 @@ static irqreturn_t dma_controller_irq(in
 	struct musb_dma_controller *controller =
 		(struct musb_dma_controller *)private_data;
 	struct musb_dma_channel *pImplChannel;
+	struct musb *musb = controller->pDmaPrivate;
 	u8 *mbase = controller->pCoreBase;
 	struct dma_channel *pChannel;
 	u8 bChannel;
@@ -303,6 +304,9 @@ static irqreturn_t dma_controller_irq(in
 	u32 dwAddress;
 	u8 int_hsdma;
 	irqreturn_t retval = IRQ_NONE;
+	unsigned long flags;
+
+	spin_lock_irqsave(&musb->lock, flags);
 
 	int_hsdma = musb_readb(mbase, MUSB_HSDMA_INTR);
 	if (!int_hsdma)
@@ -358,7 +362,7 @@ static irqreturn_t dma_controller_irq(in
 						MUSB_TXCSR_TXPKTRDY);
 				} else
 					musb_dma_completion(
-						controller->pDmaPrivate,
+						musb,
 						pImplChannel->epnum,
 						pImplChannel->transmit);
 			}
@@ -366,6 +370,7 @@ static irqreturn_t dma_controller_irq(in
 	}
 	retval = IRQ_HANDLED;
 done:
+	spin_unlock_irqrestore(&musb->lock, flags);
 	return retval;
 }
 
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-17 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31 23:31 [PATCH] ARM: OMAP: MUSB: DMA interrupt locking fix Kevin Hilman
2007-09-01  2:15 ` David Brownell
2007-09-17 18:23   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox