[PATCH] ehci: remove old TT sched code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This removes the old EHCI transaction translator scheduling code,
leaving only the "new" (now over 7 years old) scheduling code.

---

I think it's been long enough to prove the "new" tt sched
code works, and we can drop the old stuff.  Alan, Greg,
and reason to keep the old tt sched code?

This patch is against usb-next branch.

(Sorry if anyone got multiples of this email, I had send-email
config problems that blocked delivery to the list)

 drivers/usb/host/Kconfig      |  20 --------
 drivers/usb/host/ehci-sched.c | 115 ------------------------------------------
 2 files changed, 135 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 80e72fb..20cc435 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -64,26 +64,6 @@ config USB_EHCI_ROOT_HUB_TT
 	  This supports the EHCI implementation that's originally
 	  from ARC, and has since changed hands a few times.
 
-config USB_EHCI_TT_NEWSCHED
-	bool "Improved Transaction Translator scheduling"
-	depends on USB_EHCI_HCD
-	default y
-	---help---
-	  This changes the periodic scheduling code to fill more of the low
-	  and full speed bandwidth available from the Transaction Translator
-	  (TT) in USB 2.0 hubs.  Without this, only one transfer will be
-	  issued in each microframe, significantly reducing the number of
-	  periodic low/fullspeed transfers possible.
-
-	  If you have multiple periodic low/fullspeed devices connected to a
-	  highspeed USB hub which is connected to a highspeed USB Host
-	  Controller, and some of those devices will not work correctly
-	  (possibly due to "ENOSPC" or "-28" errors), say Y.  Conversely, if
-	  you have only one such device and it doesn't work, you could try
-	  saying N.
-
-	  If unsure, say Y.
-
 config USB_FSL_MPH_DR_OF
 	tristate
 
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 7ce5c2a..eaff175 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -318,8 +318,6 @@ static int __maybe_unused same_tt(struct usb_device *dev1,
 		return 1;
 }
 
-#ifdef CONFIG_USB_EHCI_TT_NEWSCHED
-
 /* Which uframe does the low/fullspeed transfer start in?
  *
  * The parameter is the mask of ssplits in "H-frame" terms
@@ -429,87 +427,6 @@ static int tt_available (
 	return 1;
 }
 
-#else
-
-/* return true iff the device's transaction translator is available
- * for a periodic transfer starting at the specified frame, using
- * all the uframes in the mask.
- */
-static int tt_no_collision (
-	struct ehci_hcd		*ehci,
-	unsigned		period,
-	struct usb_device	*dev,
-	unsigned		frame,
-	u32			uf_mask
-)
-{
-	if (period == 0)	/* error */
-		return 0;
-
-	/* note bandwidth wastage:  split never follows csplit
-	 * (different dev or endpoint) until the next uframe.
-	 * calling convention doesn't make that distinction.
-	 */
-	for (; frame < ehci->periodic_size; frame += period) {
-		union ehci_shadow	here;
-		__hc32			type;
-		struct ehci_qh_hw	*hw;
-
-		here = ehci->pshadow [frame];
-		type = Q_NEXT_TYPE(ehci, ehci->periodic [frame]);
-		while (here.ptr) {
-			switch (hc32_to_cpu(ehci, type)) {
-			case Q_TYPE_ITD:
-				type = Q_NEXT_TYPE(ehci, here.itd->hw_next);
-				here = here.itd->itd_next;
-				continue;
-			case Q_TYPE_QH:
-				hw = here.qh->hw;
-				if (same_tt(dev, here.qh->ps.udev)) {
-					u32		mask;
-
-					mask = hc32_to_cpu(ehci,
-							hw->hw_info2);
-					/* "knows" no gap is needed */
-					mask |= mask >> 8;
-					if (mask & uf_mask)
-						break;
-				}
-				type = Q_NEXT_TYPE(ehci, hw->hw_next);
-				here = here.qh->qh_next;
-				continue;
-			case Q_TYPE_SITD:
-				if (same_tt (dev, here.sitd->urb->dev)) {
-					u16		mask;
-
-					mask = hc32_to_cpu(ehci, here.sitd
-								->hw_uframe);
-					/* FIXME assumes no gap for IN! */
-					mask |= mask >> 8;
-					if (mask & uf_mask)
-						break;
-				}
-				type = Q_NEXT_TYPE(ehci, here.sitd->hw_next);
-				here = here.sitd->sitd_next;
-				continue;
-			// case Q_TYPE_FSTN:
-			default:
-				ehci_dbg (ehci,
-					"periodic frame %d bogus type %d\n",
-					frame, type);
-			}
-
-			/* collision or error */
-			return 0;
-		}
-	}
-
-	/* no collision */
-	return 1;
-}
-
-#endif /* CONFIG_USB_EHCI_TT_NEWSCHED */
-
 /*-------------------------------------------------------------------------*/
 
 static void enable_periodic(struct ehci_hcd *ehci)
@@ -812,7 +729,6 @@ static int check_intr_schedule (
 		goto done;
 	}
 
-#ifdef CONFIG_USB_EHCI_TT_NEWSCHED
 	if (tt_available(ehci, &qh->ps, tt, frame, uframe)) {
 		unsigned i;
 
@@ -828,28 +744,6 @@ static int check_intr_schedule (
 
 		*c_maskp = mask;
 	}
-#else
-	/* Make sure this tt's buffer is also available for CSPLITs.
-	 * We pessimize a bit; probably the typical full speed case
-	 * doesn't need the second CSPLIT.
-	 *
-	 * NOTE:  both SPLIT and CSPLIT could be checked in just
-	 * one smart pass...
-	 */
-	mask = 0x03 << (uframe + qh->gap_uf);
-	*c_maskp = mask;
-
-	mask |= 1 << uframe;
-	if (tt_no_collision(ehci, qh->ps.bw_period, qh->ps.udev, frame, mask)) {
-		if (!check_period(ehci, frame, uframe + qh->gap_uf + 1,
-				qh->ps.bw_uperiod, qh->ps.c_usecs))
-			goto done;
-		if (!check_period(ehci, frame, uframe + qh->gap_uf,
-				qh->ps.bw_uperiod, qh->ps.c_usecs))
-			goto done;
-		retval = 0;
-	}
-#endif
 done:
 	return retval;
 }
@@ -1430,21 +1324,12 @@ sitd_slot_ok (
 	uframe &= stream->ps.bw_uperiod - 1;
 	frame = uframe >> 3;
 
-#ifdef CONFIG_USB_EHCI_TT_NEWSCHED
 	/* The tt's fullspeed bus bandwidth must be available.
 	 * tt_available scheduling guarantees 10+% for control/bulk.
 	 */
 	uf = uframe & 7;
 	if (!tt_available(ehci, &stream->ps, tt, frame, uf))
 		return 0;
-#else
-	/* tt must be idle for start(s), any gap, and csplit.
-	 * assume scheduling slop leaves 10+% for control/bulk.
-	 */
-	if (!tt_no_collision(ehci, stream->ps.bw_period,
-			stream->ps.udev, frame, mask))
-		return 0;
-#endif
 
 	do {
 		unsigned	max_used;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux