]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: ti: edma: support sw triggered chans in of_edma_xlate()
authorMatthew Majewski <mattwmajewski@gmail.com>
Sun, 16 Feb 2025 21:47:41 +0000 (16:47 -0500)
committerVinod Koul <vkoul@kernel.org>
Mon, 10 Mar 2025 20:56:40 +0000 (02:26 +0530)
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).

Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20250216214741.207538-1-mattwmajewski@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/edma.c

index b1a54655e6ced39b237075369f26782576d4f5c4..3ed406f08c442e1930aca4d15059d914eca4b55e 100644 (file)
@@ -2259,8 +2259,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