23 ehci_writel(ehci, ehci->
command, &ehci->
regs->command);
26 ehci_readl(ehci, &ehci->
regs->command);
33 ehci_writel(ehci, ehci->
command, &ehci->
regs->command);
36 ehci_readl(ehci, &ehci->
regs->command);
69 static unsigned event_delays_ns[] = {
83 static void ehci_enable_event(
struct ehci_hcd *ehci,
unsigned event,
90 ktime_set(0, event_delays_ns[event]));
103 static void ehci_poll_ASS(
struct ehci_hcd *ehci)
105 unsigned actual, want;
112 actual = ehci_readl(ehci, &ehci->
regs->status) &
STS_ASS;
114 if (want != actual) {
121 ehci_dbg(ehci,
"Waited too long for the async schedule status (%x/%x), giving up\n",
129 ehci_set_command_bit(ehci,
CMD_ASE);
142 static void ehci_disable_ASE(
struct ehci_hcd *ehci)
144 ehci_clear_command_bit(ehci,
CMD_ASE);
149 static void ehci_poll_PSS(
struct ehci_hcd *ehci)
151 unsigned actual, want;
158 actual = ehci_readl(ehci, &ehci->
regs->status) &
STS_PSS;
160 if (want != actual) {
167 ehci_dbg(ehci,
"Waited too long for the periodic schedule status (%x/%x), giving up\n",
175 ehci_set_command_bit(ehci,
CMD_PSE);
188 static void ehci_disable_PSE(
struct ehci_hcd *ehci)
190 ehci_clear_command_bit(ehci,
CMD_PSE);
195 static void ehci_handle_controller_death(
struct ehci_hcd *ehci)
197 if (!(ehci_readl(ehci, &ehci->
regs->status) &
STS_HALT)) {
205 ehci_warn(ehci,
"Waited too long for the controller to stop, giving up\n");
210 ehci_writel(ehci, 0, &ehci->
regs->configured_flag);
211 ehci_writel(ehci, 0, &ehci->
regs->intr_enable);
213 end_unlink_async(ehci);
220 static void ehci_handle_intr_unlinks(
struct ehci_hcd *ehci)
239 end_unlink_intr(ehci, qh);
252 static void start_free_itds(
struct ehci_hcd *ehci)
266 static void end_free_itds(
struct ehci_hcd *ehci)
291 start_free_itds(ehci);
296 static void ehci_iaa_watchdog(
struct ehci_hcd *ehci)
316 cmd = ehci_readl(ehci, &ehci->
regs->command);
325 status = ehci_readl(ehci, &ehci->
regs->status);
327 COUNT(ehci->stats.lost_iaa);
328 ehci_writel(ehci, STS_IAA, &ehci->
regs->status);
331 ehci_vdbg(ehci,
"IAA watchdog: status %x cmd %x\n",
333 end_unlink_async(ehci);
339 static void turn_on_io_watchdog(
struct ehci_hcd *ehci)
365 ehci_handle_controller_death,
366 ehci_handle_intr_unlinks,
396 event_handlers[
e](ehci);
398 ehci_enable_event(ehci, e,
false);
401 spin_unlock_irqrestore(&ehci->
lock, flags);