]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: MUSB: DMA interrupt locking fix
authorKevin Hilman <khilman@mvista.com>
Fri, 31 Aug 2007 23:31:06 +0000 (16:31 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 17 Sep 2007 18:23:21 +0000 (11:23 -0700)
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>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
drivers/usb/musb/musbhsdma.c

index a45c1c0b099c69fb5ebdc171bdcfd1ba824f8727..589ca80a64e50ef943ef65854b47345f51577131 100644 (file)
@@ -296,6 +296,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
        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(int irq, void *private_data)
        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(int irq, void *private_data)
                                                MUSB_TXCSR_TXPKTRDY);
                                } else
                                        musb_dma_completion(
-                                               controller->pDmaPrivate,
+                                               musb,
                                                pImplChannel->epnum,
                                                pImplChannel->transmit);
                        }
@@ -366,6 +370,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
        }
        retval = IRQ_HANDLED;
 done:
+       spin_unlock_irqrestore(&musb->lock, flags);
        return retval;
 }