[PATCH] dmaengine: xilinx_dma: Set dma_device directions

Folker Schwesinger dev at folker-schwesinger.de
Wed May 7 03:47:08 PDT 2025


On Wed May 7, 2025 at 12:20 PM CEST, Radhey Shyam Pandey wrote:
> [snip]
>> > 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 at brueckmann-gmbh.de>
>>
>> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey at 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;
>> > +
>
> Suraj also worked on this patch internally and he did set direction in chan_probe().
> So, I think we can switch to below implementation ?
>
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -2909,6 +2909,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
>                 return -EINVAL;
>         }
>
> +       xdev->common.directions |= chan->direction;

Looks good to me.




More information about the linux-arm-kernel mailing list