Skip to content

Commit

Permalink
dma: imx-sdma: buf_tail should be initialize in prepare function
Browse files Browse the repository at this point in the history
This fix audio underrun issue. When SNDRV_PCM_TRIGGER_STOP
and SNDRV_PCM_TRIGGER_START, it calls prepare again. buf_tail
should be reset to zero.
So move buf_tail initialization into prepare function.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Richard Zhao authored and Vinod Koul committed Jun 7, 2012
1 parent 30c1dc0 commit 8e2e27c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/dma/imx-sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,6 @@ static int sdma_request_channel(struct sdma_channel *sdmac)

init_completion(&sdmac->done);

sdmac->buf_tail = 0;

return 0;
out:

Expand Down Expand Up @@ -927,6 +925,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(

sdmac->flags = 0;

sdmac->buf_tail = 0;

dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n",
sg_len, channel);

Expand Down Expand Up @@ -1027,6 +1027,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic(

sdmac->status = DMA_IN_PROGRESS;

sdmac->buf_tail = 0;

sdmac->flags |= IMX_DMA_SG_LOOP;
sdmac->direction = direction;
ret = sdma_load_context(sdmac);
Expand Down

0 comments on commit 8e2e27c

Please sign in to comment.