• David Brownell's avatar
    [PATCH] USB: ehci update: 3/3, highspeed iso rewrite · adffcfda
    David Brownell authored
    This is an updated version of a patch submitted to me from
    Michal Sojka <sojkam1@fel.cvut.cz>, basically providing a
    much-needed rewrite of the highspeed ISO support.  I updated
    the scheduling and made it a closer match to how OHCI works;
    and also tested it a bunch.
    
    So far it seems most of the requests for highspeed ISO support
    have been for realtime data collection -- custom apps, nothing
    a mainstream kernel would ship with.   The USB Video class is
    now defined; highspeed video will also need these updates.
    
    Key changes:
    
       - Define an "iso_stream" head for iso endpoints.  This acts
         enough like a QH that endpoint_disable() works.  It holds the
         queue of ITDs, and the endpoint's current schedule state.
         And it's easy to find (spinlocked array access), no search.
    
       - Uses a temporary "itd_sched" while submitting each URB, with
         not-yet-linked ITDs and request-specific metadata.  There's
         a per-stream cache of ITDs, so resubmitting ISO urbs (to
         achieve a "ring" of transfers) is typically cheap.
    
       - Scheduling for most URBs is almost a NOP:  just a sanity
         check to make sure there's no need to reschedule, and then
         just link into the schedule at the current schedule slot.
         (The previous code was a gross hack that didn't even work
         reasonably with more than two URBs queued.)
    
       - Is a reasonable model to use with full speed ISO transfers.
         (They need additional TT scheduling hooks, most of which
         are already written but not merged.)
    
       - Handles several cases the previous code didn't, including
         high bandwidth transfers (loads up to 24 MByte/sec)
    
       - Has had more testing than the old code, including 20+ hour
         successful IN+OUT runs, more varied transfer intervals and
         maxpacket sizes.  (Using net2280 and a gadgetfs driver.)
    
    So it's worth replacing the existing code with this; there
    aren't too many rough edges, and it's much more fixable than
    the previous version.
    
    
    p.s. Many thanks, Michal!
    adffcfda
ehci-dbg.c 19.3 KB