Skip to contentSkip to conversation

dmaengine: xilinx_dma: Configure parking registers only if parking enabled

PATCH Applied Marek Vasut 3 participants 3 messages Oct 31, 2024 – Dec 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: xilinx_dma: Configure parking registers only if parking enabled

The VDMA can work in two modes, parking or circular. Do not program the parking mode registers in case circular mode is used, it is useless.

---
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Peter Korsgaard <[email protected]>
Cc: Radhey Shyam Pandey <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/dma/xilinx/xilinx_dma.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/dma/xilinx/xilinx_dma.c +11 -9
index 48647c8a64a5b..87db381ff1286 100644
@@ -1404,16 +1404,18 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)
 
 	dma_ctrl_write(chan, XILINX_DMA_REG_DMACR, reg);
 
-	j = chan->desc_submitcount;
-	reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
-	if (chan->direction == DMA_MEM_TO_DEV) {
-		reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
-		reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
-	} else {
-		reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
-		reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
+	if (config->park) {
+		j = chan->desc_submitcount;
+		reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
+		if (chan->direction == DMA_MEM_TO_DEV) {
+			reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
+			reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
+		} else {
+			reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
+			reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
+		}
+		dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
 	}
-	dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
 
 	/* Start the hardware */
 	xilinx_dma_start(chan);
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, October 31, 2024 10:41 PM
To: [email protected]
Cc: Marek Vasut <[email protected]>; Uwe Kleine-König <u.kleine- [email protected]>; Simek, Michal <[email protected]>; Peter Korsgaard <[email protected]>; Pandey, Radhey Shyam <[email protected]>; Vinod Koul <[email protected]>; linux-arm- [email protected]
Subject: [PATCH] dmaengine: xilinx_dma: Configure parking registers only if parking enabled

Quoted 4 lines

The VDMA can work in two modes, parking or circular. Do not program the parking mode registers in case circular mode is used, it is useless.

Thanks!

Quoted 47 lines

---
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Peter Korsgaard <[email protected]>
Cc: Radhey Shyam Pandey <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/dma/xilinx/xilinx_dma.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/dma/xilinx/xilinx_dma.c index renamed from drivers/dma/xilinx/xilinx_dma.c +0 -0

48647c8a64a5b..87db381ff1286 100644

drivers/dma/xilinx/xilinx_dma.c +11 -9
@@ -1404,16 +1404,18 @@ static void xilinx_vdma_start_transfer(struct
 xilinx_dma_chan *chan)
 
 	dma_ctrl_write(chan, XILINX_DMA_REG_DMACR, reg);
 
-	j = chan->desc_submitcount;
-	reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
-	if (chan->direction == DMA_MEM_TO_DEV) {
-		reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
-		reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
-	} else {
-		reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
-		reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
+	if (config->park) {
+		j = chan->desc_submitcount;
+		reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
+		if (chan->direction == DMA_MEM_TO_DEV) {
+			reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
+			reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
+		} else {
+			reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
+			reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
+		}
+		dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
 	}
-	dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
 
 	/* Start the hardware */

xilinx_dma_start(chan);
--
2.45.2

maintainer Applied
#2 lore raw
In reply to Marek Vasut
Quoted 4 lines · Marek Vasut

The VDMA can work in two modes, parking or circular. Do not program the parking mode registers in case circular mode is used, it is useless.

Applied, thanks!

[1/1] dmaengine: xilinx_dma: Configure parking registers only if parking enabled

      commit: 8a20040f9de3a4ea90ab900cdd7745d57bc2da82

Best regards,

Signature · 1 line
~Vinod