• Alan Stern's avatar
    USB: EHCI: reorganize isochronous scheduler routine · 1fb2e055
    Alan Stern authored
    This patch (as1408) rearranges the scheduling code in ehci-hcd, partly
    to improve its structure, but mainly to change the way it works.
    Whether or not a transfer exceeds the hardware schedule length will
    now be determined by looking at the last frame the transfer would use,
    instead of the first available frame following the end of the transfer.
    
    The benefit of this change is that it allows the driver to accept
    valid URBs which would otherwise be rejected.  For example, suppose
    the schedule length is 1024 frames, the endpoint period is 256 frames,
    and a four-packet URB is submitted.  The four transfers would occupy
    slots that are 0, 256, 512, and 768 frames past the current frame
    (plus an extra slop factor).  These don't exceed the 1024-frame limit,
    so the URB should be accepted.  But the current code notices that the
    next available slot would be 1024 frames (plus slop) in the future,
    which is beyond the limit, and so the URB is rejected unnecessarily.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    CC: David Brownell <david-b@pacbell.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    
    1fb2e055
ehci-sched.c 63.7 KB