@@ -544,8 +544,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic(
if (mxs_chan->status == DMA_IN_PROGRESS)
return NULL;
- mxs_chan->status = DMA_IN_PROGRESS;
- mxs_chan->flags |= MXS_DMA_SG_LOOP;
+ mxs_dma_pause_chan(mxs_chan);
+ mxs_dma_reset_chan(mxs_chan);
if (num_periods > NUM_CCW) {
dev_err(mxs_dma->dma_device.dev,
@@ -585,6 +585,11 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic(
i++;
}
+ mxs_dma_resume_chan(mxs_chan);
+
+ mxs_chan->status = DMA_IN_PROGRESS;
+ mxs_chan->flags |= MXS_DMA_SG_LOOP;
+
mxs_chan->desc_count = i;
return &mxs_chan->desc;
Using mxs-dma with pcm-dmaengine with small period-length can in some cases lead to strange audio effects. This patch pauses the DMA channel while preparing cyclic DMA commands. I tested with mx28 and period-length of 160. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> --- drivers/dma/mxs-dma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)