[kernel] r18353 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Mon Dec 5 01:46:50 UTC 2011


Author: benh
Date: Mon Dec  5 01:46:49 2011
New Revision: 18353

Log:
USB: EHCI: fix HUB TT scheduling issue with iso transfer (Closes: #651015)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/EHCI-Fix-a-regression-in-the-ISO-scheduler.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/USB-EHCI-fix-HUB-TT-scheduling-issue-with-iso-transf.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/base

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Mon Dec  5 01:42:04 2011	(r18352)
+++ dists/sid/linux-2.6/debian/changelog	Mon Dec  5 01:46:49 2011	(r18353)
@@ -6,6 +6,9 @@
   [ Hector Oron ]
   * regulator: backport fix for nullpointer dereference in core.
 
+  [ Ben Hutchings ]
+  * USB: EHCI: fix HUB TT scheduling issue with iso transfer (Closes: #651015)
+
  -- Bastian Blank <waldi at debian.org>  Thu, 01 Dec 2011 13:17:34 +0100
 
 linux-2.6 (3.1.4-1) unstable; urgency=low

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/EHCI-Fix-a-regression-in-the-ISO-scheduler.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/EHCI-Fix-a-regression-in-the-ISO-scheduler.patch	Mon Dec  5 01:46:49 2011	(r18353)
@@ -0,0 +1,59 @@
+From: Matthieu CASTET <castet.matthieu at free.fr>
+Date: Mon, 28 Nov 2011 11:30:22 +0100
+Subject: [PATCH 2/2] EHCI : Fix a regression in the ISO scheduler
+
+commit e3420901eba65b1c46bed86d360e3a8685d20734 upstream.
+
+Fix a regression that was introduced by commit
+811c926c538f7e8d3c08b630dd5844efd7e000f6 (USB: EHCI: fix HUB TT scheduling
+issue with iso transfer).
+
+We detect an error if next == start, but this means uframe 0 can't be allocated
+anymore for iso transfer...
+
+Reported-by: Sander Eikelenboom <linux at eikelenboom.it>
+Signed-off-by: Matthieu CASTET <castet.matthieu at free.fr>
+Acked-by: Alan Stern <stern at rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+---
+ drivers/usb/host/ehci-sched.c |    9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
+index 56a3203..a60679c 100644
+--- a/drivers/usb/host/ehci-sched.c
++++ b/drivers/usb/host/ehci-sched.c
+@@ -1475,6 +1475,7 @@ iso_stream_schedule (
+ 	 * jump until after the queue is primed.
+ 	 */
+ 	else {
++		int done = 0;
+ 		start = SCHEDULE_SLOP + (now & ~0x07);
+ 
+ 		/* NOTE:  assumes URB_ISO_ASAP, to limit complexity/bugs */
+@@ -1492,18 +1493,18 @@ iso_stream_schedule (
+ 			if (stream->highspeed) {
+ 				if (itd_slot_ok(ehci, mod, start,
+ 						stream->usecs, period))
+-					break;
++					done = 1;
+ 			} else {
+ 				if ((start % 8) >= 6)
+ 					continue;
+ 				if (sitd_slot_ok(ehci, mod, stream,
+ 						start, sched, period))
+-					break;
++					done = 1;
+ 			}
+-		} while (start > next);
++		} while (start > next && !done);
+ 
+ 		/* no room in the schedule */
+-		if (start == next) {
++		if (!done) {
+ 			ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n",
+ 				urb, now, now + mod);
+ 			status = -ENOSPC;
+-- 
+1.7.7.3
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/USB-EHCI-fix-HUB-TT-scheduling-issue-with-iso-transf.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/USB-EHCI-fix-HUB-TT-scheduling-issue-with-iso-transf.patch	Mon Dec  5 01:46:49 2011	(r18353)
@@ -0,0 +1,106 @@
+From: Thomas Poussevin <thomas.poussevin at parrot.com>
+Date: Thu, 27 Oct 2011 18:46:48 +0200
+Subject: [PATCH 1/2] USB: EHCI: fix HUB TT scheduling issue with iso transfer
+
+commit 811c926c538f7e8d3c08b630dd5844efd7e000f6 upstream.
+
+The current TT scheduling doesn't allow to play and then record on a
+full-speed device connected to a high speed hub.
+
+The IN iso stream can only start on the first uframe (0-2 for a 165 us)
+because of CSPLIT transactions.
+For the OUT iso stream there no such restriction. uframe 0-5 are possible.
+
+The idea of this patch is that the first uframe are precious (for IN TT iso
+stream) and we should allocate the last uframes first if possible.
+
+For that we reverse the order of uframe allocation (last uframe first).
+
+Here an example :
+
+hid interrupt stream
+----------------------------------------------------------------------
+uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
+----------------------------------------------------------------------
+max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
+----------------------------------------------------------------------
+used usecs on a frame | 13  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+----------------------------------------------------------------------
+
+iso OUT stream
+----------------------------------------------------------------------
+uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
+----------------------------------------------------------------------
+max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
+----------------------------------------------------------------------
+used usecs on a frame | 13  | 125 |  39 |  0  |  0  |  0  |  0  |  0  |
+----------------------------------------------------------------------
+
+There no place for iso IN stream  (uframe 0-2 are used) and we got "cannot
+submit datapipe for urb 0, error -28: not enough bandwidth" error.
+
+With the patch this become.
+
+iso OUT stream
+----------------------------------------------------------------------
+uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
+----------------------------------------------------------------------
+max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
+----------------------------------------------------------------------
+used usecs on a frame |  13 |  0  |  0  |  0  | 125 |  39 |  0  |  0  |
+----------------------------------------------------------------------
+
+iso IN stream
+----------------------------------------------------------------------
+uframe                |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
+----------------------------------------------------------------------
+max_tt_usecs          | 125 | 125 | 125 | 125 | 125 | 125 | 30  |  0  |
+----------------------------------------------------------------------
+used usecs on a frame |  13 |  0  | 125 | 40  | 125 |  39 |  0  |  0  |
+----------------------------------------------------------------------
+
+Signed-off-by: Matthieu Castet <matthieu.castet at parrot.com>
+Signed-off-by: Thomas Poussevin <thomas.poussevin at parrot.com>
+Signed-off-by: Alan Stern <stern at rowland.harvard.edu>
+Cc: stable <stable at vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+---
+ drivers/usb/host/ehci-sched.c |   15 ++++++++++-----
+ 1 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
+index 2e829fa..56a3203 100644
+--- a/drivers/usb/host/ehci-sched.c
++++ b/drivers/usb/host/ehci-sched.c
+@@ -1479,10 +1479,15 @@ iso_stream_schedule (
+ 
+ 		/* NOTE:  assumes URB_ISO_ASAP, to limit complexity/bugs */
+ 
+-		/* find a uframe slot with enough bandwidth */
+-		next = start + period;
+-		for (; start < next; start++) {
+-
++		/* find a uframe slot with enough bandwidth.
++		 * Early uframes are more precious because full-speed
++		 * iso IN transfers can't use late uframes,
++		 * and therefore they should be allocated last.
++		 */
++		next = start;
++		start += period;
++		do {
++			start--;
+ 			/* check schedule: enough space? */
+ 			if (stream->highspeed) {
+ 				if (itd_slot_ok(ehci, mod, start,
+@@ -1495,7 +1500,7 @@ iso_stream_schedule (
+ 						start, sched, period))
+ 					break;
+ 			}
+-		}
++		} while (start > next);
+ 
+ 		/* no room in the schedule */
+ 		if (start == next) {
+-- 
+1.7.7.3
+

Modified: dists/sid/linux-2.6/debian/patches/series/base
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/base	Mon Dec  5 01:42:04 2011	(r18352)
+++ dists/sid/linux-2.6/debian/patches/series/base	Mon Dec  5 01:46:49 2011	(r18353)
@@ -80,3 +80,5 @@
 + bugfix/all/0005-media-staging-lirc_serial-Do-not-assume-error-codes-.patch
 
 + features/all/topology-Provide-CPU-topology-in-sysfs-in-SMP-configura.patch
++ bugfix/all/USB-EHCI-fix-HUB-TT-scheduling-issue-with-iso-transf.patch
++ bugfix/all/EHCI-Fix-a-regression-in-the-ISO-scheduler.patch



More information about the Kernel-svn-changes mailing list