diff options
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 471142725ffe..81cda09b47e3 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -685,8 +685,15 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
685 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 685 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
686 | u32 status, masked_status, pcd_status = 0, cmd; | 686 | u32 status, masked_status, pcd_status = 0, cmd; |
687 | int bh; | 687 | int bh; |
688 | unsigned long flags; | ||
688 | 689 | ||
689 | spin_lock (&ehci->lock); | 690 | /* |
691 | * For threadirqs option we use spin_lock_irqsave() variant to prevent | ||
692 | * deadlock with ehci hrtimer callback, because hrtimer callbacks run | ||
693 | * in interrupt context even when threadirqs is specified. We can go | ||
694 | * back to spin_lock() variant when hrtimer callbacks become threaded. | ||
695 | */ | ||
696 | spin_lock_irqsave(&ehci->lock, flags); | ||
690 | 697 | ||
691 | status = ehci_readl(ehci, &ehci->regs->status); | 698 | status = ehci_readl(ehci, &ehci->regs->status); |
692 | 699 | ||
@@ -704,7 +711,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
704 | 711 | ||
705 | /* Shared IRQ? */ | 712 | /* Shared IRQ? */ |
706 | if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) { | 713 | if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) { |
707 | spin_unlock(&ehci->lock); | 714 | spin_unlock_irqrestore(&ehci->lock, flags); |
708 | return IRQ_NONE; | 715 | return IRQ_NONE; |
709 | } | 716 | } |
710 | 717 | ||
@@ -815,7 +822,7 @@ dead: | |||
815 | 822 | ||
816 | if (bh) | 823 | if (bh) |
817 | ehci_work (ehci); | 824 | ehci_work (ehci); |
818 | spin_unlock (&ehci->lock); | 825 | spin_unlock_irqrestore(&ehci->lock, flags); |
819 | if (pcd_status) | 826 | if (pcd_status) |
820 | usb_hcd_poll_rh_status(hcd); | 827 | usb_hcd_poll_rh_status(hcd); |
821 | return IRQ_HANDLED; | 828 | return IRQ_HANDLED; |