summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-11-30 12:13:12 +0100
committerVinod Koul <vkoul@kernel.org>2023-12-21 17:21:27 +0100
commit26ee018ff6d1c326ac9b9be36513e35870ed09db (patch)
treee573c9925489bc35d3bf74c0e4277afe18c419f7
parentdmaengine: idxd: Move dma_free_coherent() out of spinlocked context (diff)
downloadlinux-26ee018ff6d1c326ac9b9be36513e35870ed09db.tar.xz
linux-26ee018ff6d1c326ac9b9be36513e35870ed09db.zip
dmaengine: xilinx: xdma: Fix the count of elapsed periods in cyclic mode
Xilinx DMA engine is capable of keeping track of the number of elapsed periods and this is an increasing 32-bit counter which is only reset when turning off the engine. No need to add this value to our local counter. Fixes: cd8c732ce1a5 ("dmaengine: xilinx: xdma: Support cyclic transfers") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20231130111315.729430-2-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/xilinx/xdma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 84a88029226f..2c9c72d4b5a2 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -754,9 +754,9 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
if (ret)
goto out;
- desc->completed_desc_num += complete_desc_num;
-
if (desc->cyclic) {
+ desc->completed_desc_num = complete_desc_num;
+
ret = regmap_read(xdev->rmap, xchan->base + XDMA_CHAN_STATUS,
&st);
if (ret)
@@ -768,6 +768,8 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
goto out;
}
+ desc->completed_desc_num += complete_desc_num;
+
/*
* if all data blocks are transferred, remove and complete the request
*/