Skip to contentSkip to conversation

dmaengine: ti: edma: support sw triggered chans in of_edma_xlate()

PATCH Applied Matthew Majewski 3 participants 3 messages Feb 16, 2025 – Mar 10, 2025

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

PATCH 1/1 dmaengine: ti: edma: support sw triggered chans in of_edma_xlate()

The .of_edma_xlate() function always sets the hw_triggered flag to true. This causes sw triggered channels consumed via the device-tree to not function properly, as the driver incorrectly assumes they are hw triggered. Modify the xlate() function to correctly set the hw_triggered flag to false for channels reserved for memcpy operation (ie, sw triggered).

---
 drivers/dma/ti/edma.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/dma/ti/edma.c +6 -2
index 4ece125b2ae7..0554a18d84ba 100644
@@ -2258,8 +2258,12 @@ static struct dma_chan *of_edma_xlate(struct of_phandle_args *dma_spec,
 
 	return NULL;
 out:
-	/* The channel is going to be used as HW synchronized */
-	echan->hw_triggered = true;
+	/*
+	 * The channel is going to be HW synchronized, unless it was
+	 * reserved as a memcpy channel
+	 */
+	echan->hw_triggered =
+		!edma_is_memcpy_channel(i, ecc->info->memcpy_channels);
 	return dma_get_slave_channel(chan);
 }
 #else
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Matthew Majewski

The .of_edma_xlate() function always sets the hw_triggered flag to true. This causes sw triggered channels consumed via the device-tree to not function properly, as the driver incorrectly assumes they are hw triggered. Modify the xlate() function to correctly set the hw_triggered flag to false for channels reserved for memcpy operation (ie, sw triggered).

Good catch,

Quoted 23 lines
---
 drivers/dma/ti/edma.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/dma/ti/edma.c +6 -2
index 4ece125b2ae7..0554a18d84ba 100644
@@ -2258,8 +2258,12 @@ static struct dma_chan *of_edma_xlate(struct of_phandle_args *dma_spec,
 
 	return NULL;
 out:
-	/* The channel is going to be used as HW synchronized */
-	echan->hw_triggered = true;
+	/*
+	 * The channel is going to be HW synchronized, unless it was
+	 * reserved as a memcpy channel
+	 */
+	echan->hw_triggered =
+		!edma_is_memcpy_channel(i, ecc->info->memcpy_channels);
 	return dma_get_slave_channel(chan);
 }
 #else
Signature · 1 line
Péter
maintainer Applied
#2 lore raw
In reply to Matthew Majewski
Quoted 8 lines · Matthew Majewski

The .of_edma_xlate() function always sets the hw_triggered flag to true. This causes sw triggered channels consumed via the device-tree to not function properly, as the driver incorrectly assumes they are hw triggered. Modify the xlate() function to correctly set the hw_triggered flag to false for channels reserved for memcpy operation (ie, sw triggered).

[...]

Applied, thanks!

[1/1] dmaengine: ti: edma: support sw triggered chans in of_edma_xlate()

      commit: e7240aba2053d437a661d946b3d413f310138a45

Best regards,

Signature · 1 line
~Vinod