dma_map_single or dma_alloc_coherent and a few other questions?

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

 



Hi,

I've written a slave SPI driver where the master continuously streams
fixed size data, 512 bytes in either direction on a 10ms time slice
with flow control for when the slave can't keep up although we are
seeing a good constant 10ms which is great.

The driver uses a ping pong buffering scheme.  So while user space is
processing one buffer the driver is filling/sending the other. I have
allocated the DMA'able buffers once in an init function using
dma_map_single and reuse them using dma_sync_single_for_device then
dmaengine_prep_slave_single.

I need to rework the driver to double the bandwidth by handling 1024
byte packets per time slice so I would like to ask a few questions to
the DMA engine experts.
1) Is dma_map_single the best option/most optimal for what I am doing
or should I be using dma_alloc_coherent?
2) Secondly it is the most optimal option to keep reusing the same buffer?
3) For handling 1024 bytes the SPI controller only handles 512 so I
have to break it up into 2 transactions, should I use 2 512 byte DMA
buffers or a single 1024 buffer if possible and update some sort of
pointer in the DMA'able buffer after the first transaction.

The Kernel is v4.1 and the DMA controller is the SDMA controller of an i.MX6UL.

Many Thanks in advance,
Martin.
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux