diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-01-08 11:17:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-20 18:24:34 -0500 |
commit | 1b9a38bfa6e664ff02511314f5586d711c83cc91 (patch) | |
tree | f58800f54386050429bb0f3a203ec012a2c153b9 /drivers/usb | |
parent | acbe2febe71abb2360b008e9ab3ee5c44169f78c (diff) |
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: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Tested-by: Glynn Farrow <farrowg@sg.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index a427d3b00634..89521775c567 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -849,9 +849,10 @@ qh_make ( | |||
849 | * But interval 1 scheduling is simpler, and | 849 | * But interval 1 scheduling is simpler, and |
850 | * includes high bandwidth. | 850 | * includes high bandwidth. |
851 | */ | 851 | */ |
852 | dbg ("intr period %d uframes, NYET!", | 852 | urb->interval = 1; |
853 | urb->interval); | 853 | } else if (qh->period > ehci->periodic_size) { |
854 | goto done; | 854 | qh->period = ehci->periodic_size; |
855 | urb->interval = qh->period << 3; | ||
855 | } | 856 | } |
856 | } else { | 857 | } else { |
857 | int think_time; | 858 | int think_time; |
@@ -874,6 +875,10 @@ qh_make ( | |||
874 | usb_calc_bus_time (urb->dev->speed, | 875 | usb_calc_bus_time (urb->dev->speed, |
875 | is_input, 0, max_packet (maxp))); | 876 | is_input, 0, max_packet (maxp))); |
876 | qh->period = urb->interval; | 877 | qh->period = urb->interval; |
878 | if (qh->period > ehci->periodic_size) { | ||
879 | qh->period = ehci->periodic_size; | ||
880 | urb->interval = qh->period; | ||
881 | } | ||
877 | } | 882 | } |
878 | } | 883 | } |
879 | 884 | ||