]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fsldma: snooping is not enabled for last entry in descriptor chain
authorIra Snyder <iws@ovro.caltech.edu>
Fri, 15 May 2009 18:33:20 +0000 (11:33 -0700)
committerLi Yang <leoli@freescale.com>
Fri, 22 May 2009 08:53:56 +0000 (16:53 +0800)
On the 83xx controller, snooping is necessary for the DMA controller to
ensure cache coherence with the CPU when transferring to/from RAM.

The last descriptor in a chain will always have the End-of-Chain interrupt
bit set, so we can set the snoop bit while adding the End-of-Chain
interrupt bit.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Li Yang <leoli@freescale.com>
drivers/dma/fsldma.c

index 7313a1ae5f833e44c8f559cb35475b27f18c338b..ff9194d7ebb7a8d74e3c2babc8c530ea4ae7f0a3 100644 (file)
@@ -179,9 +179,14 @@ static void dma_halt(struct fsl_dma_chan *fsl_chan)
 static void set_ld_eol(struct fsl_dma_chan *fsl_chan,
                        struct fsl_desc_sw *desc)
 {
+       u64 snoop_bits;
+
+       snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX)
+               ? FSL_DMA_SNEN : 0;
+
        desc->hw.next_ln_addr = CPU_TO_DMA(fsl_chan,
-               DMA_TO_CPU(fsl_chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL,
-               64);
+               DMA_TO_CPU(fsl_chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL
+                       | snoop_bits, 64);
 }
 
 static void append_ld_queue(struct fsl_dma_chan *fsl_chan,