lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[32/89] USB: EHCI: fix handling of unusual interrupt intervals
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Alan Stern <stern@rowland.harvard.edu>

    commit 1b9a38bfa6e664ff02511314f5586d711c83cc91 upstream.

    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>
    Tested-by: Glynn Farrow <farrowg@sg.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/usb/host/ehci-q.c | 11 ++++++++---
    1 file changed, 8 insertions(+), 3 deletions(-)

    --- a/drivers/usb/host/ehci-q.c
    +++ b/drivers/usb/host/ehci-q.c
    @@ -802,9 +802,10 @@ qh_make (
    * But interval 1 scheduling is simpler, and
    * includes high bandwidth.
    */
    - dbg ("intr period %d uframes, NYET!",
    - urb->interval);
    - goto done;
    + urb->interval = 1;
    + } else if (qh->period > ehci->periodic_size) {
    + qh->period = ehci->periodic_size;
    + urb->interval = qh->period << 3;
    }
    } else {
    int think_time;
    @@ -827,6 +828,10 @@ qh_make (
    usb_calc_bus_time (urb->dev->speed,
    is_input, 0, max_packet (maxp)));
    qh->period = urb->interval;
    + if (qh->period > ehci->periodic_size) {
    + qh->period = ehci->periodic_size;
    + urb->interval = qh->period;
    + }
    }
    }




    \
     
     \ /
      Last update: 2010-03-31 02:31    [W:5.699 / U:0.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site