linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings
@ 2022-07-28  7:40 Tudor Ambarus
  2022-07-29 10:59 ` Alexander Dahl
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Tudor Ambarus @ 2022-07-28  7:40 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, peda
  Cc: nicolas.ferre, alexandre.belloni, claudiu.beznea, bbrezillon,
	linux-mtd, linux-arm-kernel, linux-kernel, Tudor Ambarus, stable

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 <tudor.ambarus@microchip.com>
---
 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;
 
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2022-09-20  8:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28  7:40 [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings Tudor Ambarus
2022-07-29 10:59 ` Alexander Dahl
2022-08-09  6:28   ` Alexander Dahl
2022-08-02 11:03 ` Tudor.Ambarus
2022-08-16  9:09 ` Boris Brezillon
2022-08-17  9:28 ` Thorsten Leemhuis
2022-08-21 14:45   ` Peter Rosin
2022-09-07  9:06 ` Tudor.Ambarus
2022-09-19 15:29   ` Miquel Raynal
2022-09-20  8:10 ` Miquel Raynal

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