Commit 1b9a38bf authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: EHCI: fix handling of unusual interrupt intervals

This patch (as1320) fixes two problems related to interrupt-URB
scheduling in ehci-hcd.

	URBs with an interval of 2 or 4 microframes aren't handled.
	For the time being, the patch reduces to interval to 1 uframe.

	URBs are constrained to have an interval no larger than 1024
	frames by usb_submit_urb().  But some EHCI controllers allow
	use of a schedule as short as 256 frames; for these
	controllers we may have to decrease the interval to the
	actual schedule length.

The second problem isn't very significant since few devices expose
interrupt endpoints with an interval larger than 256 frames.  But the
first problem is critical; it will prevent the kernel from working
with devices having interrupt intervals of 2 or 4 uframes.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Tested-by: default avatarGlynn Farrow <farrowg@sg.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent acbe2feb
...@@ -849,9 +849,10 @@ qh_make ( ...@@ -849,9 +849,10 @@ qh_make (
* But interval 1 scheduling is simpler, and * But interval 1 scheduling is simpler, and
* includes high bandwidth. * includes high bandwidth.
*/ */
dbg ("intr period %d uframes, NYET!", urb->interval = 1;
urb->interval); } else if (qh->period > ehci->periodic_size) {
goto done; qh->period = ehci->periodic_size;
urb->interval = qh->period << 3;
} }
} else { } else {
int think_time; int think_time;
...@@ -874,6 +875,10 @@ qh_make ( ...@@ -874,6 +875,10 @@ qh_make (
usb_calc_bus_time (urb->dev->speed, usb_calc_bus_time (urb->dev->speed,
is_input, 0, max_packet (maxp))); is_input, 0, max_packet (maxp)));
qh->period = urb->interval; qh->period = urb->interval;
if (qh->period > ehci->periodic_size) {
qh->period = ehci->periodic_size;
urb->interval = qh->period;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment