RE: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
From: Pandey, Radhey Shyam
Date: Mon Mar 17 2025 - 02:48:35 EST
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Thomas Gessler <thomas.gessler@xxxxxxxxxxxxxxxxxx>
> Sent: Friday, March 14, 2025 7:19 PM
> To: dmaengine@xxxxxxxxxxxxxxx
> Cc: Thomas Gessler <thomas.gessler@xxxxxxxxxxxxxxxxxx>; Vinod Koul
> <vkoul@xxxxxxxxxx>; Simek, Michal <michal.simek@xxxxxxx>; Marek Vasut
> <marex@xxxxxxx>; Pandey, Radhey Shyam <radhey.shyam.pandey@xxxxxxx>;
> Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
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