aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-06-14 02:56:48 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-03 21:20:36 -0400
commit056761e55c8687ddf3db14226213f2e8dc2689bc (patch)
tree0a462ad33cc3c78bc7c520c50aa2b6c9c2a7c1cd
parent4b828abed217527ca815727a1a251334bd8e5e04 (diff)
USB: ehci - fix timer regression
This patch fixes a regression in the EHCI driver's TIMER_IO_WATCHDOG behavior. The patch "USB: EHCI: add separate IAA watchdog timer" changed how that timer is handled, so that short timeouts on the remaining timer (unfortunately, overloaded) would never be used. This takes a more direct approach, reorganizing the code slightly to be explicit about only the I/O watchdog role now being overridable. It also replaces a now-obsolete comment describing older timer behavior. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Leonid <leonidv11@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/host/ehci.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 35a03095757e..90245fd8bac4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -177,6 +177,15 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action)
177static inline void 177static inline void
178timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) 178timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
179{ 179{
180 /* Don't override timeouts which shrink or (later) disable
181 * the async ring; just the I/O watchdog. Note that if a
182 * SHRINK were pending, OFF would never be requested.
183 */
184 if (timer_pending(&ehci->watchdog)
185 && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
186 & ehci->actions))
187 return;
188
180 if (!test_and_set_bit (action, &ehci->actions)) { 189 if (!test_and_set_bit (action, &ehci->actions)) {
181 unsigned long t; 190 unsigned long t;
182 191
@@ -192,15 +201,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
192 t = EHCI_SHRINK_JIFFIES; 201 t = EHCI_SHRINK_JIFFIES;
193 break; 202 break;
194 } 203 }
195 t += jiffies; 204 mod_timer(&ehci->watchdog, t + jiffies);
196 // all timings except IAA watchdog can be overridden.
197 // async queue SHRINK often precedes IAA. while it's ready
198 // to go OFF neither can matter, and afterwards the IO
199 // watchdog stops unless there's still periodic traffic.
200 if (time_before_eq(t, ehci->watchdog.expires)
201 && timer_pending (&ehci->watchdog))
202 return;
203 mod_timer (&ehci->watchdog, t);
204 } 205 }
205} 206}
206 207