aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 4725d15d096f..f2618d17710d 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -110,6 +110,42 @@ MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications");
110 110
111/*-------------------------------------------------------------------------*/ 111/*-------------------------------------------------------------------------*/
112 112
113static void
114timer_action(struct ehci_hcd *ehci, enum ehci_timer_action action)
115{
116 /* Don't override timeouts which shrink or (later) disable
117 * the async ring; just the I/O watchdog. Note that if a
118 * SHRINK were pending, OFF would never be requested.
119 */
120 if (timer_pending(&ehci->watchdog)
121 && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
122 & ehci->actions))
123 return;
124
125 if (!test_and_set_bit(action, &ehci->actions)) {
126 unsigned long t;
127
128 switch (action) {
129 case TIMER_IO_WATCHDOG:
130 t = EHCI_IO_JIFFIES;
131 break;
132 case TIMER_ASYNC_OFF:
133 t = EHCI_ASYNC_JIFFIES;
134 break;
135 /* case TIMER_ASYNC_SHRINK: */
136 default:
137 /* add a jiffie since we synch against the
138 * 8 KHz uframe counter.
139 */
140 t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
141 break;
142 }
143 mod_timer(&ehci->watchdog, t + jiffies);
144 }
145}
146
147/*-------------------------------------------------------------------------*/
148
113/* 149/*
114 * handshake - spin reading hc until handshake completes or fails 150 * handshake - spin reading hc until handshake completes or fails
115 * @ptr: address of hc register to be read 151 * @ptr: address of hc register to be read
@@ -485,6 +521,7 @@ static int ehci_init(struct usb_hcd *hcd)
485 * periodic_size can shrink by USBCMD update if hcc_params allows. 521 * periodic_size can shrink by USBCMD update if hcc_params allows.
486 */ 522 */
487 ehci->periodic_size = DEFAULT_I_TDPS; 523 ehci->periodic_size = DEFAULT_I_TDPS;
524 INIT_LIST_HEAD(&ehci->cached_itd_list);
488 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) 525 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
489 return retval; 526 return retval;
490 527
@@ -497,6 +534,7 @@ static int ehci_init(struct usb_hcd *hcd)
497 534
498 ehci->reclaim = NULL; 535 ehci->reclaim = NULL;
499 ehci->next_uframe = -1; 536 ehci->next_uframe = -1;
537 ehci->clock_frame = -1;
500 538
501 /* 539 /*
502 * dedicate a qh for the async ring head, since we couldn't unlink 540 * dedicate a qh for the async ring head, since we couldn't unlink