• David Brownell's avatar
    [PATCH] usb_sg_{init,wait,cancel}() · 1e4fece8
    David Brownell authored
    Here are the scatterlist primitives there's been mail about before.
    Now the code has passed basic sanity testing, and is ready to merge
    into Linus' tree to start getting wider use.  Greg, please merge!
    
    To recap, the routines are a utility layer packaging several usb
    core facilities to improve system performance.  It's synchronous.
    The code uses functionality that drivers could use already, but
    generally haven't:
    
        - Request queueing.  This is a big performance win.  It lets
          device drivers help the hcds avoid wasted i/o bandwidth, by
          eliminating irq and scheduling latencies between requests.  It
          can make a huge difference at high speed, when the latencies
          often exceed the time to handle each i/o request!
    
        - The new usb_map_sg() primitives, leveraging IOMMU hardware
          if it's there (better than entry-at-a-time mapping).
    
        - URB_NO_INTERRUPT transfer flag, a hint to hcds that they
          can avoid a 'success irq' for this urb.  Only the urb for
          the last scatterlist entry really needs an IRQ, the others
          can be eliminated or delayed.  (OHCI uses this today, and
          any HCD can safely ignore it.)
    
    The particular functionality in these APIs seemed to meet Matt's
    requirements for usb-storage, so I'd hope the 2.5 usb-storage
    code will start to use these routines in a while.  (And maybe
    those two scanner drivers: hpusbscsi, microtek.)
    
    Brief summary of testing:  this code seems correct for normal
    reads and writes, but the fault paths (including cancelation)
    haven't been tested yet.  Both EHCI and OHCI seem to be mostly
    OK with these more aggressive queued loads, but may need small
    updates (like the two I sent yesterday).  Unfortunately I have
    to report that UHCI and urb queueing will sometimes lock up my
    hardware (PIIX4), so while we're lots better than 2.4 this is
    still a bit of a trouble spot for now.
    
    I'll be making some testing software available shortly, which
    will help track down remaining HCD level problems by giving the
    queuing APIs (and some others!) a more strenuous workout than
    most drivers will, in their day-to-day usage.
    
    - Dave
    1e4fece8
message.c 31.3 KB