Skip to content

Commit 7bcdaa6

Browse files
Radhey Shyam Pandeyvinodkoul
authored andcommitted
dmaengine: xilinx_dma: Freeup active list based on descriptor completion bit
AXIDMA IP in SG mode sets completion bit to 1 when the transfer is completed. Read this bit to move descriptor from active list to the done list. This feature is needed when interrupt delay timeout and IRQThreshold is enabled i.e Dly_IrqEn is triggered w/o completing interrupt threshold. Signed-off-by: Radhey Shyam Pandey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 491e9d4 commit 7bcdaa6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/dma/xilinx/xilinx_dma.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
#define XILINX_DMA_CR_COALESCE_SHIFT 16
178178
#define XILINX_DMA_BD_SOP BIT(27)
179179
#define XILINX_DMA_BD_EOP BIT(26)
180+
#define XILINX_DMA_BD_COMP_MASK BIT(31)
180181
#define XILINX_DMA_COALESCE_MAX 255
181182
#define XILINX_DMA_NUM_DESCS 512
182183
#define XILINX_DMA_NUM_APP_WORDS 5
@@ -1708,6 +1709,14 @@ static void xilinx_dma_complete_descriptor(struct xilinx_dma_chan *chan)
17081709
return;
17091710

17101711
list_for_each_entry_safe(desc, next, &chan->active_list, node) {
1712+
if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) {
1713+
struct xilinx_axidma_tx_segment *seg;
1714+
1715+
seg = list_last_entry(&desc->segments,
1716+
struct xilinx_axidma_tx_segment, node);
1717+
if (!(seg->hw.status & XILINX_DMA_BD_COMP_MASK) && chan->has_sg)
1718+
break;
1719+
}
17111720
if (chan->has_sg && chan->xdev->dma_config->dmatype !=
17121721
XDMA_TYPE_VDMA)
17131722
desc->residue = xilinx_dma_get_residue(chan, desc);

0 commit comments

Comments
 (0)