Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matthieu CASTET and committed by
Greg Kroah-Hartman
e3420901 df711fc9

+5 -4
+5 -4
drivers/usb/host/ehci-sched.c
··· 1475 1475 * jump until after the queue is primed. 1476 1476 */ 1477 1477 else { 1478 + int done = 0; 1478 1479 start = SCHEDULE_SLOP + (now & ~0x07); 1479 1480 1480 1481 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */ ··· 1493 1492 if (stream->highspeed) { 1494 1493 if (itd_slot_ok(ehci, mod, start, 1495 1494 stream->usecs, period)) 1496 - break; 1495 + done = 1; 1497 1496 } else { 1498 1497 if ((start % 8) >= 6) 1499 1498 continue; 1500 1499 if (sitd_slot_ok(ehci, mod, stream, 1501 1500 start, sched, period)) 1502 - break; 1501 + done = 1; 1503 1502 } 1504 - } while (start > next); 1503 + } while (start > next && !done); 1505 1504 1506 1505 /* no room in the schedule */ 1507 - if (start == next) { 1506 + if (!done) { 1508 1507 ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n", 1509 1508 urb, now, now + mod); 1510 1509 status = -ENOSPC;