aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMatthieu CASTET <castet.matthieu@free.fr>2011-11-28 05:30:22 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-28 19:59:29 -0500
commite3420901eba65b1c46bed86d360e3a8685d20734 (patch)
tree747ae7ec657793fba9b5523cd573f6bd25f7905b /drivers/usb
parentdf711fc9962b9491af2b92bd0d21ecbfefe4e5fa (diff)
EHCI : Fix a regression in the ISO scheduler
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@eikelenboom.it> Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-sched.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 56a32033adb..a60679cbbf8 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1475,6 +1475,7 @@ iso_stream_schedule (
1475 * jump until after the queue is primed. 1475 * jump until after the queue is primed.
1476 */ 1476 */
1477 else { 1477 else {
1478 int done = 0;
1478 start = SCHEDULE_SLOP + (now & ~0x07); 1479 start = SCHEDULE_SLOP + (now & ~0x07);
1479 1480
1480 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */ 1481 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */
@@ -1492,18 +1493,18 @@ iso_stream_schedule (
1492 if (stream->highspeed) { 1493 if (stream->highspeed) {
1493 if (itd_slot_ok(ehci, mod, start, 1494 if (itd_slot_ok(ehci, mod, start,
1494 stream->usecs, period)) 1495 stream->usecs, period))
1495 break; 1496 done = 1;
1496 } else { 1497 } else {
1497 if ((start % 8) >= 6) 1498 if ((start % 8) >= 6)
1498 continue; 1499 continue;
1499 if (sitd_slot_ok(ehci, mod, stream, 1500 if (sitd_slot_ok(ehci, mod, stream,
1500 start, sched, period)) 1501 start, sched, period))
1501 break; 1502 done = 1;
1502 } 1503 }
1503 } while (start > next); 1504 } while (start > next && !done);
1504 1505
1505 /* no room in the schedule */ 1506 /* no room in the schedule */
1506 if (start == next) { 1507 if (!done) {
1507 ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n", 1508 ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n",
1508 urb, now, now + mod); 1509 urb, now, now + mod);
1509 status = -ENOSPC; 1510 status = -ENOSPC;