[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2099405.mp5hVA6q5l@ada>
Date: Fri, 29 Jul 2022 12:59:55 +0200
From: Alexander Dahl <ada@...rsis.com>
To: linux-mtd@...ts.infradead.org
Cc: Tudor Ambarus <tudor.ambarus@...rochip.com>,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
peda@...ntia.se, nicolas.ferre@...rochip.com,
alexandre.belloni@...tlin.com, claudiu.beznea@...rochip.com,
bbrezillon@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings
Hello Tudor,
Am Donnerstag, 28. Juli 2022, 09:40:14 CEST schrieb Tudor Ambarus:
> 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@...r.kernel.org
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...rochip.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;
Acked-by: Alexander Dahl <ada@...rsis.com>
After studying
https://www.kernel.org/doc/html/latest/core-api/dma-api-howto.html
this seems like the correct thing to do to me.
I was made aware of this patch in IRC, after discussing a strange lzo
decompression and/or page reading error with Richard after upgrading from
kernel v5.2.21-rt13 to v5.15.49-rt47.
Now testing this on top of 5.15.49-rt47 on two boards, both with Microchip
sama5d27c 128MiB SiP and Spansion S34ML02G1 raw nand flash. Will report later.
Thanks and greets
Alex
Powered by blists - more mailing lists