diff options
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 94388738a6f7..66310894ad97 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1434,21 +1434,20 @@ iso_stream_schedule ( | |||
1434 | 1434 | ||
1435 | /* Behind the scheduling threshold? */ | 1435 | /* Behind the scheduling threshold? */ |
1436 | if (unlikely(start < next)) { | 1436 | if (unlikely(start < next)) { |
1437 | unsigned now2 = (now - base) & (mod - 1); | ||
1437 | 1438 | ||
1438 | /* USB_ISO_ASAP: Round up to the first available slot */ | 1439 | /* USB_ISO_ASAP: Round up to the first available slot */ |
1439 | if (urb->transfer_flags & URB_ISO_ASAP) | 1440 | if (urb->transfer_flags & URB_ISO_ASAP) |
1440 | start += (next - start + period - 1) & -period; | 1441 | start += (next - start + period - 1) & -period; |
1441 | 1442 | ||
1442 | /* | 1443 | /* |
1443 | * Not ASAP: Use the next slot in the stream. If | 1444 | * Not ASAP: Use the next slot in the stream, |
1444 | * the entire URB falls before the threshold, fail. | 1445 | * no matter what. |
1445 | */ | 1446 | */ |
1446 | else if (start + span - period < next) { | 1447 | else if (start + span - period < now2) { |
1447 | ehci_dbg(ehci, "iso urb late %p (%u+%u < %u)\n", | 1448 | ehci_dbg(ehci, "iso underrun %p (%u+%u < %u)\n", |
1448 | urb, start + base, | 1449 | urb, start + base, |
1449 | span - period, next + base); | 1450 | span - period, now2 + base); |
1450 | status = -EXDEV; | ||
1451 | goto fail; | ||
1452 | } | 1451 | } |
1453 | } | 1452 | } |
1454 | 1453 | ||