[PATCH 1/5] dmaengine: mxs-dma: add dma support for i.MX23/28

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Feb 8 11:38:13 EST 2011


On Wed, Feb 09, 2011 at 06:56:36AM +0800, Shawn Guo wrote:
> Hi Russell,
> 
> Thanks for the review and comments.
> 
> Hi Sascha,
> 
> Some of the comments here also apply on imx-sdma, as mxs-dma closely
> followed imx-sdma implementation.  It's appreciated if you can give 
> some responses to the comments.
> 
> On Fri, Feb 04, 2011 at 06:17:49PM +0000, Russell King - ARM Linux wrote:
> > Callbacks are supposed to happen from tasklet context, not irq context.
> > 
> 
> Here is callback copied from mxs-mmc driver.  I expect other mxs-dma
> client driver's callbacks are as simple as this one.
> 
> static void mxs_mmc_dma_irq_callback(void *param)
> {
> 	struct mxs_mmc_host *host = param;
> 
> 	host->status = __raw_readl(host->base + HW_SSP_STATUS);
> 	complete(&host->done);
> }
> 
> Is a simple callback also required be in tasklet context anyhow?

It is part of the DMA engine API specification.  It may not matter
for stuff which currently exists, but how do you know that in the
future you won't be re-using existing drivers which do other stuff
in callbacks and do assume that they're correctly called as per the
DMA engine API?

If you're not going to implement your driver to the DMA engine API
specification, there's no point implementing something which looks
like a DMA engine API but isn't.



More information about the linux-arm-kernel mailing list