public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: xilinx_dma: Set dma_device directions
@ 2025-03-14 13:48 Thomas Gessler
  2025-03-14 15:09 ` Folker Schwesinger
  2025-03-17  6:48 ` Pandey, Radhey Shyam
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Gessler @ 2025-03-14 13:48 UTC (permalink / raw)
  To: dmaengine
  Cc: Thomas Gessler, Vinod Koul, Michal Simek, Marek Vasut,
	Radhey Shyam Pandey, Uwe Kleine-König, linux-arm-kernel,
	linux-kernel

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(+)

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-03-14 13:48 [PATCH] dmaengine: xilinx_dma: Set dma_device directions Thomas Gessler
@ 2025-03-14 15:09 ` Folker Schwesinger
  2025-03-17  6:48 ` Pandey, Radhey Shyam
  1 sibling, 0 replies; 7+ messages in thread
From: Folker Schwesinger @ 2025-03-14 15:09 UTC (permalink / raw)
  To: Thomas Gessler, dmaengine
  Cc: Vinod Koul, Michal Simek, Marek Vasut, Radhey Shyam Pandey,
	Uwe Kleine-König, linux-arm-kernel, linux-kernel

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])



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-03-14 13:48 [PATCH] dmaengine: xilinx_dma: Set dma_device directions Thomas Gessler
  2025-03-14 15:09 ` Folker Schwesinger
@ 2025-03-17  6:48 ` Pandey, Radhey Shyam
  2025-05-07 10:20   ` Pandey, Radhey Shyam
  1 sibling, 1 reply; 7+ messages in thread
From: Pandey, Radhey Shyam @ 2025-03-17  6:48 UTC (permalink / raw)
  To: Thomas Gessler, dmaengine@vger.kernel.org
  Cc: Vinod Koul, Simek, Michal, Marek Vasut, Uwe Kleine-König,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Katakam, Harini

[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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-03-17  6:48 ` Pandey, Radhey Shyam
@ 2025-05-07 10:20   ` Pandey, Radhey Shyam
  2025-05-07 10:47     ` Folker Schwesinger
  2025-05-07 10:59     ` Geßler, Thomas
  0 siblings, 2 replies; 7+ messages in thread
From: Pandey, Radhey Shyam @ 2025-05-07 10:20 UTC (permalink / raw)
  To: Thomas Gessler, dmaengine@vger.kernel.org
  Cc: Vinod Koul, Simek, Michal, Marek Vasut, Uwe Kleine-König,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Katakam, Harini, Gupta, Suraj

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Pandey, Radhey Shyam
> Sent: Monday, March 17, 2025 12:18 PM
> To: Thomas Gessler <thomas.gessler@brueckmann-gmbh.de>;
> dmaengine@vger.kernel.org
> Cc: Vinod Koul <vkoul@kernel.org>; Simek, Michal <michal.simek@amd.com>;
> Marek Vasut <marex@denx.de>; Uwe Kleine-König <u.kleine-
> koenig@baylibre.com>; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; Katakam, Harini <harini.katakam@amd.com>
> Subject: RE: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
>
> > -----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;
> > +

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;


> >     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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-05-07 10:20   ` Pandey, Radhey Shyam
@ 2025-05-07 10:47     ` Folker Schwesinger
  2025-05-07 10:59     ` Geßler, Thomas
  1 sibling, 0 replies; 7+ messages in thread
From: Folker Schwesinger @ 2025-05-07 10:47 UTC (permalink / raw)
  To: Pandey, Radhey Shyam, Thomas Gessler, dmaengine@vger.kernel.org
  Cc: Vinod Koul, Simek, Michal, Marek Vasut, Uwe Kleine-König,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Katakam, Harini, Gupta, Suraj

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@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;
>> > +
>
> 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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-05-07 10:20   ` Pandey, Radhey Shyam
  2025-05-07 10:47     ` Folker Schwesinger
@ 2025-05-07 10:59     ` Geßler, Thomas
  2025-05-07 11:02       ` Pandey, Radhey Shyam
  1 sibling, 1 reply; 7+ messages in thread
From: Geßler, Thomas @ 2025-05-07 10:59 UTC (permalink / raw)
  To: Pandey, Radhey Shyam
  Cc: dmaengine, Vinod Koul, Simek, Michal, Marek Vasut,
	Uwe Kleine-König, linux-arm-kernel, linux-kernel,
	Katakam, Harini, Gupta, Suraj

----- Am 7. Mai 2025 um 12:20 schrieb Pandey, Radhey Shyam radhey.shyam.pandey@amd.com:
> Suraj also worked on this patch internally and he did set direction in
> chan_probe().
> So, I think we can switch to below implementation ?

That's fine by me.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
  2025-05-07 10:59     ` Geßler, Thomas
@ 2025-05-07 11:02       ` Pandey, Radhey Shyam
  0 siblings, 0 replies; 7+ messages in thread
From: Pandey, Radhey Shyam @ 2025-05-07 11:02 UTC (permalink / raw)
  To: Geßler, Thomas
  Cc: dmaengine@vger.kernel.org, Vinod Koul, Simek, Michal, Marek Vasut,
	Uwe Kleine-König, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Katakam, Harini, Gupta, Suraj

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Geßler, Thomas <thomas.gessler@brueckmann-gmbh.de>
> Sent: Wednesday, May 7, 2025 4:29 PM
> To: Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>
> Cc: dmaengine@vger.kernel.org; Vinod Koul <vkoul@kernel.org>; Simek, Michal
> <michal.simek@amd.com>; Marek Vasut <marex@denx.de>; Uwe Kleine-König
> <u.kleine-koenig@baylibre.com>; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; Katakam, Harini <harini.katakam@amd.com>; Gupta,
> Suraj <Suraj.Gupta2@amd.com>
> Subject: Re: [PATCH] dmaengine: xilinx_dma: Set dma_device directions
>
> ----- Am 7. Mai 2025 um 12:20 schrieb Pandey, Radhey Shyam
> radhey.shyam.pandey@amd.com:
> > Suraj also worked on this patch internally and he did set direction in
> > chan_probe().
> > So, I think we can switch to below implementation ?
>
> That's fine by me.

If you can respin v2 with it that would be great.

Thanks,
Radhey

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-07 11:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 13:48 [PATCH] dmaengine: xilinx_dma: Set dma_device directions Thomas Gessler
2025-03-14 15:09 ` Folker Schwesinger
2025-03-17  6:48 ` Pandey, Radhey Shyam
2025-05-07 10:20   ` Pandey, Radhey Shyam
2025-05-07 10:47     ` Folker Schwesinger
2025-05-07 10:59     ` Geßler, Thomas
2025-05-07 11:02       ` Pandey, Radhey Shyam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox