diff mbox series

dmaengine: xilinx_dma: Set dma_device directions

Message ID 20250314134849.703819-1-thomas.gessler@brueckmann-gmbh.de (mailing list archive)
State New
Headers show
Series dmaengine: xilinx_dma: Set dma_device directions | expand

Commit Message

Thomas Gessler March 14, 2025, 1:48 p.m. UTC
Coalesce the direction bits from the enabled TX and/or RX channels into
the directions bit mask of dma_device. Without this mask set,
dma_get_slave_caps() in the DMAEngine fails, which prevents the driver
from being used with an IIO DMAEngine buffer.

Signed-off-by: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>
---
 drivers/dma/xilinx/xilinx_dma.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Folker Schwesinger March 14, 2025, 3:09 p.m. UTC | #1
On Fri Mar 14, 2025 at 2:48 PM CET, Thomas Gessler wrote:
> Coalesce the direction bits from the enabled TX and/or RX channels into
> the directions bit mask of dma_device. Without this mask set,
> dma_get_slave_caps() in the DMAEngine fails, which prevents the driver
> from being used with an IIO DMAEngine buffer.
>
> Signed-off-by: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>

Tested-by: Folker Schwesinger <dev@folker-schwesinger.de>

> ---
>  drivers/dma/xilinx/xilinx_dma.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 108a7287f4cd..641aaf0c0f1c 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3205,6 +3205,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	for (i = 0; i < xdev->dma_config->max_channels; i++)
> +		if (xdev->chan[i])
> +			xdev->common.directions |= xdev->chan[i]->direction;
> +
>  	if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
>  		for (i = 0; i < xdev->dma_config->max_channels; i++)
>  			if (xdev->chan[i])
Pandey, Radhey Shyam March 17, 2025, 6:48 a.m. UTC | #2
[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>
> Sent: Friday, March 14, 2025 7:19 PM
> To: dmaengine@vger.kernel.org
> Cc: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>; Vinod Koul
> <vkoul@kernel.org>; Simek, Michal <michal.simek@amd.com>; Marek Vasut
> <marex@denx.de>; Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>;
> Uwe Kleine-König <u.kleine-koenig@baylibre.com>; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
>
> Coalesce the direction bits from the enabled TX and/or RX channels into
> the directions bit mask of dma_device. Without this mask set,
> dma_get_slave_caps() in the DMAEngine fails, which prevents the driver
> from being used with an IIO DMAEngine buffer.
>
> Signed-off-by: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Thanks!

> ---
>  drivers/dma/xilinx/xilinx_dma.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 108a7287f4cd..641aaf0c0f1c 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3205,6 +3205,10 @@ static int xilinx_dma_probe(struct platform_device
> *pdev)
>               }
>       }
>
> +     for (i = 0; i < xdev->dma_config->max_channels; i++)
> +             if (xdev->chan[i])
> +                     xdev->common.directions |= xdev->chan[i]->direction;
> +
>       if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
>               for (i = 0; i < xdev->dma_config->max_channels; i++)
>                       if (xdev->chan[i])
> --
> 2.43.0
diff mbox series

Patch

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 108a7287f4cd..641aaf0c0f1c 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3205,6 +3205,10 @@  static int xilinx_dma_probe(struct platform_device *pdev)
 		}
 	}
 
+	for (i = 0; i < xdev->dma_config->max_channels; i++)
+		if (xdev->chan[i])
+			xdev->common.directions |= xdev->chan[i]->direction;
+
 	if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
 		for (i = 0; i < xdev->dma_config->max_channels; i++)
 			if (xdev->chan[i])