From b3d09da7e1771decc6833d1fa662bf994948c8e6 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 16 Sep 2014 22:45:56 +0300 Subject: [PATCH 1/2] dmaengine: omap-dma: Add memory barrier to dma_resume path Add mb() call to resume path to ensure the necessary barrier. Resume can happen after waking up from suspend for example. Signed-off-by: Peter Ujfalusi Acked-by: Russell King Signed-off-by: Vinod Koul --- drivers/dma/omap-dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 4cf7d9a950d7..c01ea505ee7c 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -1017,6 +1017,8 @@ static int omap_dma_resume(struct omap_chan *c) return -EINVAL; if (c->paused) { + mb(); + omap_dma_start(c, c->desc); c->paused = false; } From bfb607451786829430ecdd5bcd51c5dac03e3639 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 16 Sep 2014 22:45:57 +0300 Subject: [PATCH 2/2] dmaengine: omap-dma: Restore the CLINK_CTRL in resume path When the audio stream is paused or suspended we stop the sDMA and when it is unpaused/resumed we start the channel without reconfiguring it. The omap_dma_stop() clears the link configuration when we pause the dma, but it is not setting it back on start. This will result only one audio buffer to be played back and the DMA will stop, since the linking is disabled. We need to restore the CLINK_CTRL register in case of resume. Signed-off-by: Peter Ujfalusi Acked-by: Russell King Signed-off-by: Vinod Koul --- drivers/dma/omap-dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index c01ea505ee7c..bbea8243f9e8 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -1019,6 +1019,9 @@ static int omap_dma_resume(struct omap_chan *c) if (c->paused) { mb(); + /* Restore channel link register */ + omap_dma_chan_write(c, CLNK_CTRL, c->desc->clnk_ctrl); + omap_dma_start(c, c->desc); c->paused = false; }