xHCI: release spinlock when setup interrupt
authorAndiry Xu <andiry.xu@amd.com>
Wed, 27 Oct 2010 08:44:52 +0000 (16:44 +0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 11 Nov 2010 18:36:51 +0000 (10:36 -0800)
Jiri Slaby reports spinlock is held while calling kmalloc(GFP_KERNEL)
and request_irq() in xhci_resume().

Release the spinlock when setup interrupt.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci.c

index 5d7d4e951ea4bc951c4783729472467a383ec1c2..7c8d70fbe113fd36791b8288c9c3b65e9365bed9 100644 (file)
@@ -714,6 +714,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
                return retval;
        }
 
+       spin_unlock_irq(&xhci->lock);
        /* Re-setup MSI-X */
        if (hcd->irq)
                free_irq(hcd->irq, hcd);
@@ -736,6 +737,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
                hcd->irq = pdev->irq;
        }
 
+       spin_lock_irq(&xhci->lock);
        /* step 4: set Run/Stop bit */
        command = xhci_readl(xhci, &xhci->op_regs->command);
        command |= CMD_RUN;