aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-09-28 16:01:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 11:57:43 -0400
commit98cae42d82fe9c9e2b5dacdf391edaa007e147e5 (patch)
tree1fc9be10a439d0557d673ca570b48dce3e56df79 /drivers
parentc3ee9b76aa93fbf59727e02fac9914c7355108f3 (diff)
EHCI: use the isochronous scheduling threshold
This patch (as1609) changes the way ehci-hcd uses the "Isochronous Scheduling Threshold" in its calculations. Until now the code has ignored the threshold except for certain Intel PCI-based controllers. This violates the EHCI spec. The new code takes the threshold into account always, removing the need for the fs_i_thresh quirk flag. In addition it implements the "full frame cache" setting more efficiently, moving forward only as far as the next frame boundary instead of always moving forward 8 microframes. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-pci.c1
-rw-r--r--drivers/usb/host/ehci-sched.c12
-rw-r--r--drivers/usb/host/ehci.h1
4 files changed, 5 insertions, 11 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 6bf6c42481e8..61eac96441de 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -503,7 +503,7 @@ static int ehci_init(struct usb_hcd *hcd)
503 503
504 /* controllers may cache some of the periodic schedule ... */ 504 /* controllers may cache some of the periodic schedule ... */
505 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache 505 if (HCC_ISOC_CACHE(hcc_params)) // full frame cache
506 ehci->i_thresh = 2 + 8; 506 ehci->i_thresh = 0;
507 else // N microframes cached 507 else // N microframes cached
508 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); 508 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
509 509
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 2cb7d370c4ef..d1407f8d42b1 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -103,7 +103,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
103 } 103 }
104 break; 104 break;
105 case PCI_VENDOR_ID_INTEL: 105 case PCI_VENDOR_ID_INTEL:
106 ehci->fs_i_thresh = 1;
107 if (pdev->device == PCI_DEVICE_ID_INTEL_CE4100_USB) 106 if (pdev->device == PCI_DEVICE_ID_INTEL_CE4100_USB)
108 hcd->has_tt = 1; 107 hcd->has_tt = 1;
109 break; 108 break;
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 7eb242f27c00..b764cab2ab9a 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1391,15 +1391,11 @@ iso_stream_schedule (
1391 */ 1391 */
1392 if (likely (!list_empty (&stream->td_list))) { 1392 if (likely (!list_empty (&stream->td_list))) {
1393 1393
1394 /* For high speed devices, allow scheduling within the 1394 /* Take the isochronous scheduling threshold into account */
1395 * isochronous scheduling threshold. For full speed devices 1395 if (ehci->i_thresh)
1396 * and Intel PCI-based controllers, don't (work around for 1396 next = now + ehci->i_thresh; /* uframe cache */
1397 * Intel ICH9 bug).
1398 */
1399 if (!stream->highspeed && ehci->fs_i_thresh)
1400 next = now + ehci->i_thresh;
1401 else 1397 else
1402 next = now; 1398 next = (now + 2 + 7) & ~0x07; /* full frame cache */
1403 1399
1404 /* 1400 /*
1405 * Use ehci->last_iso_frame as the base. There can't be any 1401 * Use ehci->last_iso_frame as the base. There can't be any
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 0564a63f5eb3..4ddf7c51616b 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -193,7 +193,6 @@ struct ehci_hcd { /* one per controller */
193 unsigned has_amcc_usb23:1; 193 unsigned has_amcc_usb23:1;
194 unsigned need_io_watchdog:1; 194 unsigned need_io_watchdog:1;
195 unsigned amd_pll_fix:1; 195 unsigned amd_pll_fix:1;
196 unsigned fs_i_thresh:1; /* Intel iso scheduling */
197 unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/ 196 unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/
198 unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ 197 unsigned has_synopsys_hc_bug:1; /* Synopsys HC */
199 unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ 198 unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */