aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-12-31 02:45:19 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:35:02 -0500
commitaa16ca307ee2da304d3a5fc0fc5e50ef8047c9e9 (patch)
tree2937e5c34b5eeb1ef18811e412aa9c8b61ee38b7
parent3b6fcfd0664aeac6ae2fd1231f04b3ed24723c1e (diff)
USB: ehci: minor ISO updates, always support split ISO
Small updates to the EHCI driver's ISO support: - Get rid of the Kconfig option for full speed ISO. It may not be perfect yet, but it hasn't appeared to be dangerous and pretty much every configuration wants it. - Instead of two places to disable an empty periodic schedule after an ISO transfer completes, just have one. - After the periodic schedule is disabled, we can short-circuit the schedule scan ... it can't possibly have more work to do. Assuming a typical config with split iso enabled, the only change in behavior should be almost unobservable: quicker termination of periodic scans when the schedule gets emptied. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/host/Kconfig9
-rw-r--r--drivers/usb/host/ehci-sched.c47
2 files changed, 12 insertions, 44 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 3a42bcd27d30..d97b16b52efa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -29,15 +29,6 @@ config USB_EHCI_HCD
29 To compile this driver as a module, choose M here: the 29 To compile this driver as a module, choose M here: the
30 module will be called ehci-hcd. 30 module will be called ehci-hcd.
31 31
32config USB_EHCI_SPLIT_ISO
33 bool "Full speed ISO transactions (EXPERIMENTAL)"
34 depends on USB_EHCI_HCD && EXPERIMENTAL
35 default n
36 ---help---
37 This code is new and hasn't been used with many different
38 EHCI or USB 2.0 transaction translator implementations.
39 It should work for ISO-OUT transfers, like audio.
40
41config USB_EHCI_ROOT_HUB_TT 32config USB_EHCI_ROOT_HUB_TT
42 bool "Root Hub Transaction Translators (EXPERIMENTAL)" 33 bool "Root Hub Transaction Translators (EXPERIMENTAL)"
43 depends on USB_EHCI_HCD && EXPERIMENTAL 34 depends on USB_EHCI_HCD && EXPERIMENTAL
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 1a94e6cec419..001b2c389be2 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1630,16 +1630,12 @@ itd_complete (
1630 BUG_ON (itd->urb == urb); 1630 BUG_ON (itd->urb == urb);
1631 */ 1631 */
1632 1632
1633 /* give urb back to the driver ... can be out-of-order */ 1633 /* give urb back to the driver; completion often (re)submits */
1634 dev = urb->dev; 1634 dev = urb->dev;
1635 ehci_urb_done(ehci, urb, 0); 1635 ehci_urb_done(ehci, urb, 0);
1636 retval = true; 1636 retval = true;
1637 urb = NULL; 1637 urb = NULL;
1638
1639 /* defer stopping schedule; completion can submit */
1640 ehci->periodic_sched--; 1638 ehci->periodic_sched--;
1641 if (unlikely (!ehci->periodic_sched))
1642 (void) disable_periodic (ehci);
1643 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 1639 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1644 1640
1645 if (unlikely (list_empty (&stream->td_list))) { 1641 if (unlikely (list_empty (&stream->td_list))) {
@@ -1725,8 +1721,6 @@ done:
1725 return status; 1721 return status;
1726} 1722}
1727 1723
1728#ifdef CONFIG_USB_EHCI_SPLIT_ISO
1729
1730/*-------------------------------------------------------------------------*/ 1724/*-------------------------------------------------------------------------*/
1731 1725
1732/* 1726/*
@@ -2016,16 +2010,12 @@ sitd_complete (
2016 BUG_ON (sitd->urb == urb); 2010 BUG_ON (sitd->urb == urb);
2017 */ 2011 */
2018 2012
2019 /* give urb back to the driver */ 2013 /* give urb back to the driver; completion often (re)submits */
2020 dev = urb->dev; 2014 dev = urb->dev;
2021 ehci_urb_done(ehci, urb, 0); 2015 ehci_urb_done(ehci, urb, 0);
2022 retval = true; 2016 retval = true;
2023 urb = NULL; 2017 urb = NULL;
2024
2025 /* defer stopping schedule; completion can submit */
2026 ehci->periodic_sched--; 2018 ehci->periodic_sched--;
2027 if (!ehci->periodic_sched)
2028 (void) disable_periodic (ehci);
2029 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 2019 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
2030 2020
2031 if (list_empty (&stream->td_list)) { 2021 if (list_empty (&stream->td_list)) {
@@ -2108,26 +2098,6 @@ done:
2108 return status; 2098 return status;
2109} 2099}
2110 2100
2111#else
2112
2113static inline int
2114sitd_submit (struct ehci_hcd *ehci, struct urb *urb, gfp_t mem_flags)
2115{
2116 ehci_dbg (ehci, "split iso support is disabled\n");
2117 return -ENOSYS;
2118}
2119
2120static inline unsigned
2121sitd_complete (
2122 struct ehci_hcd *ehci,
2123 struct ehci_sitd *sitd
2124) {
2125 ehci_err (ehci, "sitd_complete %p?\n", sitd);
2126 return 0;
2127}
2128
2129#endif /* USB_EHCI_SPLIT_ISO */
2130
2131/*-------------------------------------------------------------------------*/ 2101/*-------------------------------------------------------------------------*/
2132 2102
2133static void 2103static void
@@ -2252,8 +2222,14 @@ restart:
2252 } 2222 }
2253 2223
2254 /* assume completion callbacks modify the queue */ 2224 /* assume completion callbacks modify the queue */
2255 if (unlikely (modified)) 2225 if (unlikely (modified)) {
2256 goto restart; 2226 if (likely(ehci->periodic_sched > 0))
2227 goto restart;
2228 /* maybe we can short-circuit this scan! */
2229 disable_periodic(ehci);
2230 now_uframe = clock;
2231 break;
2232 }
2257 } 2233 }
2258 2234
2259 /* stop when we catch up to the HC */ 2235 /* stop when we catch up to the HC */
@@ -2269,7 +2245,8 @@ restart:
2269 if (now_uframe == clock) { 2245 if (now_uframe == clock) {
2270 unsigned now; 2246 unsigned now;
2271 2247
2272 if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) 2248 if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)
2249 || ehci->periodic_sched == 0)
2273 break; 2250 break;
2274 ehci->next_uframe = now_uframe; 2251 ehci->next_uframe = now_uframe;
2275 now = ehci_readl(ehci, &ehci->regs->frame_index) % mod; 2252 now = ehci_readl(ehci, &ehci->regs->frame_index) % mod;