dmaengine: axi-dmac: Only use hardware cyclic mode for single segment transfers
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 5 Sep 2017 08:16:37 +0000 (10:16 +0200)
committerVinod Koul <vinod.koul@intel.com>
Sun, 17 Sep 2017 13:28:18 +0000 (18:58 +0530)
In hardware cyclic mode the submitted segment is repeated. This means
hardware cyclic mode can only be used if the transfer has a single segment.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dma-axi-dmac.c

index 7f0b9aa158679aca780d86890426339f48586f4b..eb289aa187dd97ae2c755bb2207013d4abd6019b 100644 (file)
@@ -220,9 +220,11 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan)
 
        /*
         * If the hardware supports cyclic transfers and there is no callback to
-        * call, enable hw cyclic mode to avoid unnecessary interrupts.
+        * call and only a single segment, enable hw cyclic mode to avoid
+        * unnecessary interrupts.
         */
-       if (chan->hw_cyclic && desc->cyclic && !desc->vdesc.tx.callback)
+       if (chan->hw_cyclic && desc->cyclic && !desc->vdesc.tx.callback &&
+               desc->num_sgs == 1)
                flags |= AXI_DMAC_FLAG_CYCLIC;
 
        axi_dmac_write(dmac, AXI_DMAC_REG_X_LENGTH, sg->x_len - 1);