Skip to content

Commit 72376e1

Browse files
nunojsagastmaier
authored andcommitted
dma: dma-axi-dmac: fix SW cyclic transfers
If 'hw_cyclic' is false we should still be able to do cyclic transfers in "software". That was not working for the case where 'desc->num_sgs' is 1 because 'chan->next_desc' is never set with the current desc which means that the cyclic transfer only runs once and in the next SOT interrupt we do nothing since vchan_next_desc() will return NULL. Fix it by setting 'chan->next_desc' as soon as we get a new desc via vchan_next_desc(). Fixes: 0e3b67b ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller") Signed-off-by: Nuno Sá <[email protected]> (cherry picked from commit 016f2de)
1 parent d2f4682 commit 72376e1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/dma/dma-axi-dmac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan)
250250
return;
251251
list_move_tail(&vdesc->node, &chan->active_descs);
252252
desc = to_axi_dmac_desc(vdesc);
253+
chan->next_desc = desc;
253254
}
254255
sg = &desc->sg[desc->num_submitted];
255256

@@ -268,8 +269,6 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan)
268269
else
269270
chan->next_desc = NULL;
270271
flags |= AXI_DMAC_FLAG_LAST;
271-
} else {
272-
chan->next_desc = desc;
273272
}
274273

275274
sg->hw->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID);

0 commit comments

Comments
 (0)