dmaengine: at_xdmac: fix bad behavior in interleaved mode
[firefly-linux-kernel-4.4.55.git] / drivers / dma / at_xdmac.c
index c344f89a77e84e722864113d5b516361c047dd6e..bda49519b6de9d6d5e316b9d7bd7f25cea2aca88 100644 (file)
@@ -965,7 +965,9 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
                                                        NULL,
                                                        src_addr, dst_addr,
                                                        xt, xt->sgl);
-               for (i = 0; i < xt->numf; i++)
+
+               /* Length of the block is (BLEN+1) microblocks. */
+               for (i = 0; i < xt->numf - 1; i++)
                        at_xdmac_increment_block_count(chan, first);
 
                dev_dbg(chan2dev(chan), "%s: add desc 0x%p to descs_list 0x%p\n",