linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks
@ 2023-03-16  9:33 Harini Katakam
  2023-03-21 14:45 ` Michal Simek
  2023-03-31 12:24 ` Vinod Koul
  0 siblings, 2 replies; 5+ messages in thread
From: Harini Katakam @ 2023-03-16  9:33 UTC (permalink / raw)
  To: vkoul, romain.perier, allen.lkml, yukuai3
  Cc: dmaengine, linux-arm-kernel, linux-kernel, harinikatakamlinux,
	michal.simek, harini.katakam, radhey.shyam.pandey

Align ZDMA DMA as well as coherent memory masks to 44 bit. This is
required when using >32 bit memory regions.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
---
 drivers/dma/xilinx/zynqmp_dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 3f4ee3954384..34d7d20ffc09 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1051,7 +1051,11 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
 	zdev->dev = &pdev->dev;
 	INIT_LIST_HEAD(&zdev->common.channels);
 
-	dma_set_mask(&pdev->dev, DMA_BIT_MASK(44));
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44));
+	if (ret) {
+		dev_err(&pdev->dev, "DMA not available for address range\n");
+		return ret;
+	}
 	dma_cap_set(DMA_MEMCPY, zdev->common.cap_mask);
 
 	p = &zdev->common;
-- 
2.17.1


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

* Re: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks
  2023-03-16  9:33 [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks Harini Katakam
@ 2023-03-21 14:45 ` Michal Simek
  2023-03-21 15:04   ` Katakam, Harini
  2023-03-31 12:24 ` Vinod Koul
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Simek @ 2023-03-21 14:45 UTC (permalink / raw)
  To: Harini Katakam, vkoul, romain.perier, allen.lkml, yukuai3
  Cc: dmaengine, linux-arm-kernel, linux-kernel, harinikatakamlinux,
	radhey.shyam.pandey



On 3/16/23 10:33, Harini Katakam wrote:
> Align ZDMA DMA as well as coherent memory masks to 44 bit. This is
> required when using >32 bit memory regions.

It doesn't look like description aligned with the change below.
You are using 44 bit already and the patch itself just checking return value 
from that function.

M

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

* RE: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks
  2023-03-21 14:45 ` Michal Simek
@ 2023-03-21 15:04   ` Katakam, Harini
  2023-03-21 15:15     ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Katakam, Harini @ 2023-03-21 15:04 UTC (permalink / raw)
  To: Simek, Michal, vkoul, romain.perier, allen.lkml, yukuai3
  Cc: dmaengine, linux-arm-kernel, linux-kernel, harinikatakamlinux,
	Pandey, Radhey Shyam

Hi Michal,

> -----Original Message-----
> From: Simek, Michal <michal.simek@amd.com>
> Sent: Tuesday, March 21, 2023 8:15 PM
> To: Katakam, Harini <harini.katakam@amd.com>; vkoul@kernel.org;
> romain.perier@gmail.com; allen.lkml@gmail.com; yukuai3@huawei.com
> Cc: dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; harinikatakamlinux@gmail.com; Pandey, Radhey
> Shyam <radhey.shyam.pandey@amd.com>
> Subject: Re: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent
> masks
> 
> 
> 
> On 3/16/23 10:33, Harini Katakam wrote:
> > Align ZDMA DMA as well as coherent memory masks to 44 bit. This is
> > required when using >32 bit memory regions.
> 
> It doesn't look like description aligned with the change below.
> You are using 44 bit already and the patch itself just checking return value
> from that function.

Current code sets dma_set_mask; I changed it to dma_set_mask_and_coherent

Regards,
Harini

> 
> M

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

* Re: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks
  2023-03-21 15:04   ` Katakam, Harini
@ 2023-03-21 15:15     ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2023-03-21 15:15 UTC (permalink / raw)
  To: Katakam, Harini, vkoul, romain.perier, allen.lkml, yukuai3
  Cc: dmaengine, linux-arm-kernel, linux-kernel, harinikatakamlinux,
	Pandey, Radhey Shyam



On 3/21/23 16:04, Katakam, Harini wrote:
> Hi Michal,
> 
>> -----Original Message-----
>> From: Simek, Michal <michal.simek@amd.com>
>> Sent: Tuesday, March 21, 2023 8:15 PM
>> To: Katakam, Harini <harini.katakam@amd.com>; vkoul@kernel.org;
>> romain.perier@gmail.com; allen.lkml@gmail.com; yukuai3@huawei.com
>> Cc: dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
>> kernel@vger.kernel.org; harinikatakamlinux@gmail.com; Pandey, Radhey
>> Shyam <radhey.shyam.pandey@amd.com>
>> Subject: Re: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent
>> masks
>>
>>
>>
>> On 3/16/23 10:33, Harini Katakam wrote:
>>> Align ZDMA DMA as well as coherent memory masks to 44 bit. This is
>>> required when using >32 bit memory regions.
>>
>> It doesn't look like description aligned with the change below.
>> You are using 44 bit already and the patch itself just checking return value
>> from that function.
> 
> Current code sets dma_set_mask; I changed it to dma_set_mask_and_coherent

Ah ok. Then

Acked-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

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

* Re: [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks
  2023-03-16  9:33 [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks Harini Katakam
  2023-03-21 14:45 ` Michal Simek
@ 2023-03-31 12:24 ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2023-03-31 12:24 UTC (permalink / raw)
  To: Harini Katakam
  Cc: romain.perier, allen.lkml, yukuai3, dmaengine, linux-arm-kernel,
	linux-kernel, harinikatakamlinux, michal.simek,
	radhey.shyam.pandey

On 16-03-23, 15:03, Harini Katakam wrote:
> Align ZDMA DMA as well as coherent memory masks to 44 bit. This is
> required when using >32 bit memory regions.

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2023-03-31 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16  9:33 [PATCH] dmaengine: zynqmp_dma: Sync DMA and coherent masks Harini Katakam
2023-03-21 14:45 ` Michal Simek
2023-03-21 15:04   ` Katakam, Harini
2023-03-21 15:15     ` Michal Simek
2023-03-31 12:24 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).