gadget framework data alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,


I am wondering about using dma with gadget.

>From what I understand gadget function can put anything in req->buf.
That is the case for u_ether that puts skb->data.

But if the driver wants to do dma they need a buffer aligned on a cache
boundary (to clean/invalidate/flush buffer).

Who should do the job ?
- Gadget function should provide "provide DMA-safe buffers" like in spi
subsystem ?
- Driver need to copy the data in a safe buffer.



Matthieu

[1]
  - Follow standard kernel rules, and provide DMA-safe buffers in
    your messages.  That way controller drivers using DMA aren't forced
    to make extra copies unless the hardware requires it (e.g. working
    around hardware errata that force the use of bounce buffering).

    If standard dma_map_single() handling of these buffers is inappropriate,
    you can use spi_message.is_dma_mapped to tell the controller driver
    that you've already provided the relevant DMA addresses.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux