Merge 3.12-rc3 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -216,31 +216,26 @@ static int ohci_urb_enqueue (
|
||||
frame &= ~(ed->interval - 1);
|
||||
frame |= ed->branch;
|
||||
urb->start_frame = frame;
|
||||
ed->last_iso = frame + ed->interval * (size - 1);
|
||||
}
|
||||
} else if (ed->type == PIPE_ISOCHRONOUS) {
|
||||
u16 next = ohci_frame_no(ohci) + 1;
|
||||
u16 frame = ed->last_iso + ed->interval;
|
||||
u16 length = ed->interval * (size - 1);
|
||||
|
||||
/* Behind the scheduling threshold? */
|
||||
if (unlikely(tick_before(frame, next))) {
|
||||
|
||||
/* USB_ISO_ASAP: Round up to the first available slot */
|
||||
/* URB_ISO_ASAP: Round up to the first available slot */
|
||||
if (urb->transfer_flags & URB_ISO_ASAP) {
|
||||
frame += (next - frame + ed->interval - 1) &
|
||||
-ed->interval;
|
||||
|
||||
/*
|
||||
* Not ASAP: Use the next slot in the stream. If
|
||||
* the entire URB falls before the threshold, fail.
|
||||
* Not ASAP: Use the next slot in the stream,
|
||||
* no matter what.
|
||||
*/
|
||||
} else {
|
||||
if (tick_before(frame + ed->interval *
|
||||
(urb->number_of_packets - 1), next)) {
|
||||
retval = -EXDEV;
|
||||
usb_hcd_unlink_urb_from_ep(hcd, urb);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some OHCI hardware doesn't handle late TDs
|
||||
* correctly. After retiring them it proceeds
|
||||
@@ -251,9 +246,16 @@ static int ohci_urb_enqueue (
|
||||
urb_priv->td_cnt = DIV_ROUND_UP(
|
||||
(u16) (next - frame),
|
||||
ed->interval);
|
||||
if (urb_priv->td_cnt >= urb_priv->length) {
|
||||
++urb_priv->td_cnt; /* Mark it */
|
||||
ohci_dbg(ohci, "iso underrun %p (%u+%u < %u)\n",
|
||||
urb, frame, length,
|
||||
next);
|
||||
}
|
||||
}
|
||||
}
|
||||
urb->start_frame = frame;
|
||||
ed->last_iso = frame + length;
|
||||
}
|
||||
|
||||
/* fill the TDs and link them to the ed; and
|
||||
|
Reference in New Issue
Block a user