[PATCH 3/4] dmaengine: Add Freescale i.MX SDMA support

Dan Williams dan.j.williams at intel.com
Thu Oct 7 20:14:59 EDT 2010


On Thu, Sep 30, 2010 at 6:56 AM, Sascha Hauer <s.hauer at pengutronix.de> wrote:
> This patch adds support for the Freescale i.MX SDMA engine.
>

Applied, this set, however...

> +static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
> +               struct dma_chan *chan, struct scatterlist *sgl,
> +               unsigned int sg_len, enum dma_data_direction direction,
> +               unsigned long flags)
> +{
> +       struct sdma_channel *sdmac = to_sdma_chan(chan);
> +       struct sdma_engine *sdma = sdmac->sdma;
> +       int ret, i, count;
> +       int channel = chan->chan_id;
> +       struct scatterlist *sg;
> +
> +       if (sdmac->status == DMA_IN_PROGRESS)
> +               return NULL;
> +       sdmac->status = DMA_IN_PROGRESS;

...shouldn't this be an atomic test and set operation to ensure a
single user at a time?

--
Dan



More information about the linux-arm-kernel mailing list