OK, so it looks like URBs need to learn about highmem.

Here's a quick proposal.  It's rather first-drafty, and needs
discussion (for a week or so?).

    - Add to struct urb:

        struct page *page;    /* [in] transfer buffer page */
        unsigned offset;        /* [in] offset within page */

    - When transfer_buffer is null, that means page+offset
      is used to indicate the start of a buffer.  The length is
      still specified by transfer_buffer_length.

    - EITHER:

        * each HCD is modified to manage page DMA
          mappings if needed, in the same places they now
          handle the single shot DMA mappings

    - OR:

        *  the (new) hcd layer does this, once.  In that case
          it'd be advantageous to add another field to the
          URB, just for HCDs to use:

            dma_addr_t dma;        /* [hcd] address for transfer */

A few things to note about that proposal:

    - It doesn't apply to SETUP packets.  Those would still
      work the current way.  There's not a lot of reason to
      expect those eight bytes would be in highmem ...

    - It doesn't address ISO transfers.  Other folk know more
      than I do about how they're used, and whether they'd
      even need highmem.  (The "transfer_buffer" isn't used
      for ISO transfers...)

    - If the mappings are set up/destroyed in the HCD layer,
      so that HCD internals talk "dma+transfer_length" ...

      That would enable a new a new non-URB bulk transfer
      request that would allow a minor optimization.  It could
      talk directly in terms of scatterlists, calling pci_map_sg()
      which can sometimes coalesce page buffers.  The API
      would not be _necessary_ to support scatter/gather I/O,
      since it can already be done with bulk queueing.

The main issue I'd poke at is what to do with non-bulk
transfers, notably ISO.

An alternative approach, passing a scatterlist plus length
instead of page plus offset, would change HCD internals
substantially, and thus destabilize things (IMO needlessly).
I'm not sure I see anyone interested in doing that work.

- Dave



_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to