Skip to content

Commit 58b61fc

Browse files
miquelraynalvinodkoul
authored andcommitted
dmaengine: xilinx: xdma: Clarify the logic between cyclic/sg modes
We support both modes, but they perform totally different taks in the interrupt handler. Clarify what shall be done in each case. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 26ee018 commit 58b61fc

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

drivers/dma/xilinx/xdma.c

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -765,26 +765,23 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
765765
regmap_write(xdev->rmap, xchan->base + XDMA_CHAN_STATUS, st);
766766

767767
vchan_cyclic_callback(vd);
768-
goto out;
769-
}
770-
771-
desc->completed_desc_num += complete_desc_num;
768+
} else {
769+
desc->completed_desc_num += complete_desc_num;
772770

773-
/*
774-
* if all data blocks are transferred, remove and complete the request
775-
*/
776-
if (desc->completed_desc_num == desc->desc_num) {
777-
list_del(&vd->node);
778-
vchan_cookie_complete(vd);
779-
goto out;
780-
}
771+
/* if all data blocks are transferred, remove and complete the request */
772+
if (desc->completed_desc_num == desc->desc_num) {
773+
list_del(&vd->node);
774+
vchan_cookie_complete(vd);
775+
goto out;
776+
}
781777

782-
if (desc->completed_desc_num > desc->desc_num ||
783-
complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT)
784-
goto out;
778+
if (desc->completed_desc_num > desc->desc_num ||
779+
complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT)
780+
goto out;
785781

786-
/* transfer the rest of data (SG only) */
787-
xdma_xfer_start(xchan);
782+
/* transfer the rest of data */
783+
xdma_xfer_start(xchan);
784+
}
788785

789786
out:
790787
spin_unlock(&xchan->vchan.lock);

0 commit comments

Comments
 (0)