dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] dmaengine: xilinx_dma: Set DMA mask for coherent APIs
       [not found] <1629363528-30347-1-git-send-email-radhey.shyam.pandey@xilinx.com>
@ 2021-08-25 14:34 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-08-25 14:34 UTC (permalink / raw)
  To: Radhey Shyam Pandey; +Cc: appana.durga.rao, michal.simek, dmaengine

On 19-08-21, 14:28, Radhey Shyam Pandey wrote:
> The xilinx dma driver uses the consistent allocations, so for correct
> operation also set the DMA mask for coherent APIs. It fixes the below
> kernel crash with dmatest client when DMA IP is configured with 64-bit
> address width and linux is booted from high (>4GB) memory.

Applied, thanks

-- 
~Vinod

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

* [PATCH] dmaengine: xilinx_dma: Set DMA mask for coherent APIs
@ 2021-08-19  9:09 Radhey Shyam Pandey
  0 siblings, 0 replies; 2+ messages in thread
From: Radhey Shyam Pandey @ 2021-08-19  9:09 UTC (permalink / raw)
  To: vkoul, michal.simek; +Cc: dmaengine, linux-kernel, git, Radhey Shyam Pandey

The xilinx dma driver uses the consistent allocations, so for correct
operation also set the DMA mask for coherent APIs. It fixes the below
kernel crash with dmatest client when DMA IP is configured with 64-bit
address width and linux is booted from high (>4GB) memory.

Call trace:
[  489.531257]  dma_alloc_from_pool+0x8c/0x1c0
[  489.535431]  dma_direct_alloc+0x284/0x330
[  489.539432]  dma_alloc_attrs+0x80/0xf0
[  489.543174]  dma_pool_alloc+0x160/0x2c0
[  489.547003]  xilinx_cdma_prep_memcpy+0xa4/0x180
[  489.551524]  dmatest_func+0x3cc/0x114c
[  489.555266]  kthread+0x124/0x130
[  489.558486]  ret_from_fork+0x10/0x3c
[  489.562051] ---[ end trace 248625b2d596a90a ]---

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Harini Katakam <harini.katakam@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 75c0b8e904e5..ca59e02758c5 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3065,7 +3065,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 		xdev->ext_addr = false;
 
 	/* Set the dma mask bits */
-	dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width));
+	dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
 
 	/* Initialize the DMA engine */
 	xdev->common.dev = &pdev->dev;
-- 
2.7.4


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

end of thread, other threads:[~2021-08-25 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1629363528-30347-1-git-send-email-radhey.shyam.pandey@xilinx.com>
2021-08-25 14:34 ` [PATCH] dmaengine: xilinx_dma: Set DMA mask for coherent APIs Vinod Koul
2021-08-19  9:09 Radhey Shyam Pandey

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