diff options
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 2e829fae6482..a60679cbbf85 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1475,30 +1475,36 @@ 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 */ |
1481 | 1482 | ||
1482 | /* find a uframe slot with enough bandwidth */ | 1483 | /* find a uframe slot with enough bandwidth. |
1483 | next = start + period; | 1484 | * Early uframes are more precious because full-speed |
1484 | for (; start < next; start++) { | 1485 | * iso IN transfers can't use late uframes, |
1485 | 1486 | * and therefore they should be allocated last. | |
1487 | */ | ||
1488 | next = start; | ||
1489 | start += period; | ||
1490 | do { | ||
1491 | start--; | ||
1486 | /* check schedule: enough space? */ | 1492 | /* check schedule: enough space? */ |
1487 | if (stream->highspeed) { | 1493 | if (stream->highspeed) { |
1488 | if (itd_slot_ok(ehci, mod, start, | 1494 | if (itd_slot_ok(ehci, mod, start, |
1489 | stream->usecs, period)) | 1495 | stream->usecs, period)) |
1490 | break; | 1496 | done = 1; |
1491 | } else { | 1497 | } else { |
1492 | if ((start % 8) >= 6) | 1498 | if ((start % 8) >= 6) |
1493 | continue; | 1499 | continue; |
1494 | if (sitd_slot_ok(ehci, mod, stream, | 1500 | if (sitd_slot_ok(ehci, mod, stream, |
1495 | start, sched, period)) | 1501 | start, sched, period)) |
1496 | break; | 1502 | done = 1; |
1497 | } | 1503 | } |
1498 | } | 1504 | } while (start > next && !done); |
1499 | 1505 | ||
1500 | /* no room in the schedule */ | 1506 | /* no room in the schedule */ |
1501 | if (start == next) { | 1507 | if (!done) { |
1502 | 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", |
1503 | urb, now, now + mod); | 1509 | urb, now, now + mod); |
1504 | status = -ENOSPC; | 1510 | status = -ENOSPC; |