diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-11-30 12:13:13 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-12-21 21:51:27 +0530 |
commit | 58b61fc75ba901b1fd63c911b31249f36d17e9c4 (patch) | |
tree | 080d650ef15083cc097464baead40ddde5f2f915 /drivers/dma/xilinx | |
parent | 26ee018ff6d1c326ac9b9be36513e35870ed09db (diff) |
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20231130111315.729430-3-miquel.raynal@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/xilinx')
-rw-r--r-- | drivers/dma/xilinx/xdma.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index 2c9c72d4b5a2..4efef1b5f89c 100644 --- a/drivers/dma/xilinx/xdma.c +++ b/drivers/dma/xilinx/xdma.c @@ -765,26 +765,23 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id) regmap_write(xdev->rmap, xchan->base + XDMA_CHAN_STATUS, st); vchan_cyclic_callback(vd); - goto out; - } - - desc->completed_desc_num += complete_desc_num; + } else { + desc->completed_desc_num += complete_desc_num; - /* - * if all data blocks are transferred, remove and complete the request - */ - if (desc->completed_desc_num == desc->desc_num) { - list_del(&vd->node); - vchan_cookie_complete(vd); - goto out; - } + /* if all data blocks are transferred, remove and complete the request */ + if (desc->completed_desc_num == desc->desc_num) { + list_del(&vd->node); + vchan_cookie_complete(vd); + goto out; + } - if (desc->completed_desc_num > desc->desc_num || - complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT) - goto out; + if (desc->completed_desc_num > desc->desc_num || + complete_desc_num != XDMA_DESC_BLOCK_NUM * XDMA_DESC_ADJACENT) + goto out; - /* transfer the rest of data (SG only) */ - xdma_xfer_start(xchan); + /* transfer the rest of data */ + xdma_xfer_start(xchan); + } out: spin_unlock(&xchan->vchan.lock); |