Commit e1944017839d7dfbf7329fac4bdec8b4050edf5e

Authored by Alan Stern
Committed by Greg Kroah-Hartman
1 parent 997ff89360

USB: fix latency in uhci-hcd and ohci-hcd

Commits c44b225077bb1fb25ed5cd5c4f226897b91bedd4 (UHCI: implement new
semantics for URB_ISO_ASAP) and
6a41b4d3fe8cd4cc95181516fc6fba7b1747a27c (OHCI: implement new
semantics for URB_ISO_ASAP) increased the latency for isochronous URBs
in uhci-hcd and ohci-hcd respectively to 2 milliseconds, in an
attempt to avoid underruns.  It turns out that not only was this
unnecessary -- 1-ms latency works okay -- it also causes problems with
certain application loads such as real-time audio.

This patch changes the latency for both drivers back to 1 ms.

This should be applied to -stable kernels going back to 3.8.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Joe Rayhawk <jrayhawk@fairlystable.org>
CC: Clemens Ladisch <clemens@ladisch.de>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

drivers/usb/host/ohci-hcd.c
... ... @@ -233,7 +233,7 @@
233 233 urb->start_frame = frame;
234 234 }
235 235 } else if (ed->type == PIPE_ISOCHRONOUS) {
236   - u16 next = ohci_frame_no(ohci) + 2;
  236 + u16 next = ohci_frame_no(ohci) + 1;
237 237 u16 frame = ed->last_iso + ed->interval;
238 238  
239 239 /* Behind the scheduling threshold? */
drivers/usb/host/uhci-q.c
... ... @@ -1287,7 +1287,7 @@
1287 1287 return -EINVAL; /* Can't change the period */
1288 1288  
1289 1289 } else {
1290   - next = uhci->frame_number + 2;
  1290 + next = uhci->frame_number + 1;
1291 1291  
1292 1292 /* Find the next unused frame */
1293 1293 if (list_empty(&qh->queue)) {