]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dma: mv_xor: Flush descriptors before activating a channel
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Wed, 26 Mar 2014 15:00:17 +0000 (12:00 -0300)
committerDan Williams <dan.j.williams@intel.com>
Thu, 10 Apr 2014 19:26:17 +0000 (12:26 -0700)
We need to use writel() instead of writel_relaxed() when starting
a channel, to ensure all the descriptors have been flushed before
the activation.

While at it, remove the unneeded read-modify-write and make the
code simpler.

Cc: <stable@vger.kernel.org>
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/mv_xor.c

index 8eca90d8cd4cc0e37e68989e9f4361969ca4ba34..7938272f2edf4faf63518874153298a707e03098 100644 (file)
@@ -191,12 +191,10 @@ static void mv_set_mode(struct mv_xor_chan *chan,
 
 static void mv_chan_activate(struct mv_xor_chan *chan)
 {
-       u32 activation;
-
        dev_dbg(mv_chan_to_devp(chan), " activate chan.\n");
-       activation = readl_relaxed(XOR_ACTIVATION(chan));
-       activation |= 0x1;
-       writel_relaxed(activation, XOR_ACTIVATION(chan));
+
+       /* writel ensures all descriptors are flushed before activation */
+       writel(BIT(0), XOR_ACTIVATION(chan));
 }
 
 static char mv_chan_is_busy(struct mv_xor_chan *chan)