[RFC PATCH] fsldma: Add DMA_SLAVE support

Ira Snyder iws at ovro.caltech.edu
Thu Jun 4 04:10:38 EST 2009


On Fri, May 15, 2009 at 03:56:59PM -0700, Ira Snyder wrote:
> Use the DMA_SLAVE capability of the DMAEngine API to copy/from a
> scatterlist into an arbitrary list of hardware address/length pairs.
> 
> This allows a single DMA transaction to copy data from several different
> devices into a scatterlist at the same time.
> 
> This also adds support to enable some controller-specific features such as
> external start and external pause of a DMA transaction.
> 
> Signed-off-by: Ira W. Snyder <iws at ovro.caltech.edu>
> ---
> 
> This is a request for comments on this patch. I hunch it is not quite
> ready for inclusion, though it is certainly ready for review. Correct
> functioning of this patch depends on the patches submitted earlier.
> 
> As suggested by Dan Williams, I implemented DMA_SLAVE support for the
> fsldma controller to allow me to use the hardware to transfer to/from a
> scatterlist to a list of hardware address/length pairs.
> 
> I implemented support for the extra features available in the DMA
> controller, such as external pause and external start. I have not tested
> the features yet. I am willing to drop the support if everything else
> looks good.
> 
> I have implemented helper functions for creating the list of hardware
> address/length pairs as static inline functions in the linux/fsldma.h
> header. Should I incorporate these into the driver itself and use
> EXPORT_SYMBOL()? I've never done this before :)
> 

Any comments on this patch?

I've tested the external start feature, and it works great. I had to set
the DMA Request Count (in the mode register) after the driver was in
control. There is no interface for doing this in the existing driver. I
just ioremap()ed the registers and added the value from my driver after
claiming the channel with dma_request_channel().

There are ways to get the DMA controller into a state where the CB bit
stays set no matter what you do. I have only seen this during an
externally controlled transfer, when the external master does weird
things. I would fix this state in terminate_all(), but I have been
unsuccessful in getting the DMA controller working again after it has
been messed up.

Ira



More information about the Linuxppc-dev mailing list