USB: EHCI: use hrtimer for the I/O watchdog

This patch (as1586) replaces the kernel timer used by ehci-hcd as an
I/O watchdog with an hrtimer event.

Unlike in the current code, the watchdog event is now always enabled
whenever any isochronous URBs are active.  This will prevent bugs
caused by the periodic schedule wrapping around with no completion
interrupts; the watchdog handler is guaranteed to scan the isochronous
transfers at least once during each iteration of the schedule.  The
extra overhead will be negligible: one timer interrupt every 100 ms.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alan Stern
2012-07-11 11:23:04 -04:00
committed by Greg Kroah-Hartman
parent 569b394f53
commit 18aafe64d7
6 changed files with 25 additions and 65 deletions

View File

@@ -489,6 +489,7 @@ static void enable_periodic(struct ehci_hcd *ehci)
/* Don't start the schedule until PSS is 0 */
ehci_poll_PSS(ehci);
turn_on_io_watchdog(ehci);
}
static void disable_periodic(struct ehci_hcd *ehci)
@@ -1649,7 +1650,6 @@ static void itd_link_urb(
iso_sched_free (stream, iso_sched);
urb->hcpriv = NULL;
timer_action (ehci, TIMER_IO_WATCHDOG);
++ehci->isoc_count;
enable_periodic(ehci);
}
@@ -2052,7 +2052,6 @@ static void sitd_link_urb(
iso_sched_free (stream, sched);
urb->hcpriv = NULL;
timer_action (ehci, TIMER_IO_WATCHDOG);
++ehci->isoc_count;
enable_periodic(ehci);
}