aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-11 11:22:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 19:54:25 -0400
commitbf6387bcd16975ba8952b094f262a359d74e1c8a (patch)
treeac578ff256a5cd972c5866525c65e44e4360974e /drivers/usb/host/ehci-hcd.c
parentdf2022553dd8d34d49e16c19d851ea619438f0ef (diff)
USB: EHCI: use hrtimer for controller death
This patch (as1578) adds an hrtimer event to handle the death of an EHCI controller. When a controller dies, it doesn't necessarily stop running right away. The new event polls at 1-ms intervals to see when all activity has safely stopped. This replaces a busy-wait polling loop in the current code. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index edcfd2c4295e..1676c66b8530 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -888,20 +888,20 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
888 /* PCI errors [4.15.2.4] */ 888 /* PCI errors [4.15.2.4] */
889 if (unlikely ((status & STS_FATAL) != 0)) { 889 if (unlikely ((status & STS_FATAL) != 0)) {
890 ehci_err(ehci, "fatal error\n"); 890 ehci_err(ehci, "fatal error\n");
891 ehci->rh_state = EHCI_RH_STOPPING;
892 dbg_cmd(ehci, "fatal", cmd); 891 dbg_cmd(ehci, "fatal", cmd);
893 dbg_status(ehci, "fatal", status); 892 dbg_status(ehci, "fatal", status);
894 ehci_halt(ehci);
895dead: 893dead:
896 ehci->enabled_hrtimer_events = 0;
897 hrtimer_try_to_cancel(&ehci->hrtimer);
898 ehci_reset(ehci);
899 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
900 usb_hc_died(hcd); 894 usb_hc_died(hcd);
901 /* generic layer kills/unlinks all urbs, then 895
902 * uses ehci_stop to clean up the rest 896 /* Don't let the controller do anything more */
903 */ 897 ehci->rh_state = EHCI_RH_STOPPING;
904 bh = 1; 898 ehci->command &= ~(CMD_RUN | CMD_ASE | CMD_PSE);
899 ehci_writel(ehci, ehci->command, &ehci->regs->command);
900 ehci_writel(ehci, 0, &ehci->regs->intr_enable);
901 ehci_handle_controller_death(ehci);
902
903 /* Handle completions when the controller stops */
904 bh = 0;
905 } 905 }
906 906
907 if (bh) 907 if (bh)