aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-03-18 12:04:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-18 19:05:58 -0400
commit6d5df8976266d8e40603601f7695537f9f3dc9e2 (patch)
tree7870d6ddb4ca6a5cee7d5e2923ddecd0b3c7305a
parent413fd1e9aa3e0441e64ed4703ce1bba164e135c0 (diff)
USB: EHCI: decrease schedule-status poll timeout
This patch (as1657) decreases the timeout used by ehci-hcd for polling the async and periodic schedule statuses. The timeout is currently set to 20 ms, which is much too high. Controllers should always update the schedule status within one or two ms of being told to do so; if they don't then something is wrong. Furthermore, bug reports have shown that sometimes controllers (particularly those made by VIA) don't update the status bit at all, even when the schedule does change state. When this happens, polling for 20 ms would cause an unnecessarily long delay. The delay is reduced to somewhere between 2 and 4 ms, depending on the slop allowed by the kernel's high-res timers. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ehci-timer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-timer.c b/drivers/usb/host/ehci-timer.c
index 20dbdcbe9b0f..cc9ad5892d19 100644
--- a/drivers/usb/host/ehci-timer.c
+++ b/drivers/usb/host/ehci-timer.c
@@ -113,8 +113,8 @@ static void ehci_poll_ASS(struct ehci_hcd *ehci)
113 113
114 if (want != actual) { 114 if (want != actual) {
115 115
116 /* Poll again later, but give up after about 20 ms */ 116 /* Poll again later, but give up after about 2-4 ms */
117 if (ehci->ASS_poll_count++ < 20) { 117 if (ehci->ASS_poll_count++ < 2) {
118 ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true); 118 ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true);
119 return; 119 return;
120 } 120 }
@@ -159,8 +159,8 @@ static void ehci_poll_PSS(struct ehci_hcd *ehci)
159 159
160 if (want != actual) { 160 if (want != actual) {
161 161
162 /* Poll again later, but give up after about 20 ms */ 162 /* Poll again later, but give up after about 2-4 ms */
163 if (ehci->PSS_poll_count++ < 20) { 163 if (ehci->PSS_poll_count++ < 2) {
164 ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true); 164 ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true);
165 return; 165 return;
166 } 166 }