Thread (10 messages) 10 messages, 6 authors, 2022-09-20

Re: [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings

From: Boris Brezillon <boris.brezillon@collabora.com>
Date: 2022-08-16 10:08:18
Also in: lkml, stable

On Thu, 28 Jul 2022 10:40:14 +0300
Tudor Ambarus [off-list ref] wrote:
Every dma_map_single() call should have its dma_unmap_single() counterpart,
because the DMA address space is a shared resource and one could render the
machine unusable by consuming all DMA addresses.

Cc: stable@vger.kernel.org
Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: Tudor Ambarus <redacted>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
quoted hunk ↗ jump to hunk
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 6ef14442c71a..330d2dafdd2d 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -405,6 +405,7 @@ static int atmel_nand_dma_transfer(struct atmel_nand_controller *nc,
 
 	dma_async_issue_pending(nc->dmac);
 	wait_for_completion(&finished);
+	dma_unmap_single(nc->dev, buf_dma, len, dir);
 
 	return 0;
 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help