USB: xhci: fix lock-inversion problem
[pandora-kernel.git] / drivers / usb / host / xhci-ring.c
index 69e8289..74ed210 100644 (file)
@@ -2645,11 +2645,12 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
        union xhci_trb *trb;
        union xhci_trb *event_ring_deq;
        irqreturn_t ret = IRQ_NONE;
+       unsigned long flags;
        dma_addr_t deq;
        u64 temp_64;
        u32 status;
 
-       spin_lock(&xhci->lock);
+       spin_lock_irqsave(&xhci->lock, flags);
        trb = xhci->event_ring->dequeue;
        /* Check if the xHC generated the interrupt, or the irq is shared */
        status = xhci_readl(xhci, &xhci->op_regs->status);
@@ -2724,7 +2725,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
        ret = IRQ_HANDLED;
 
 out:
-       spin_unlock(&xhci->lock);
+       spin_unlock_irqrestore(&xhci->lock, flags);
 
        return ret;
 }