Commit 59871902703c47acc730555be41bd9cb36d3700c

Authored by Russell King
1 parent 965aeb4df1

dmaengine: omap-dma: move barrier to omap_dma_start_desc()

We don't need to issue a barrier for every segment of a DMA transfer;
doing this just once per descriptor will do.

Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff

drivers/dma/omap-dma.c
... ... @@ -195,7 +195,6 @@
195 195  
196 196 val = c->plat->dma_read(CCR, c->dma_ch);
197 197 val |= CCR_ENABLE;
198   - mb();
199 198 c->plat->dma_write(val, CCR, c->dma_ch);
200 199 }
201 200  
... ... @@ -300,6 +299,13 @@
300 299  
301 300 c->desc = d = to_omap_dma_desc(&vd->tx);
302 301 c->sgidx = 0;
  302 +
  303 + /*
  304 + * This provides the necessary barrier to ensure data held in
  305 + * DMA coherent memory is visible to the DMA engine prior to
  306 + * the transfer starting.
  307 + */
  308 + mb();
303 309  
304 310 c->plat->dma_write(d->ccr, CCR, c->dma_ch);
305 311 if (dma_omap1())