[PATCH] mtd: rawnand: stm32_fmc2: retire data DMA before unmapping on errors
Miquel Raynal
miquel.raynal at bootlin.com
Fri Oct 30 08:30:01 PDT 2026
On 30/10/2026 at 15:18:43 GMT, Samarth Narang <samarth.colleges at gmail.com> wrote:
> When ECC descriptor preparation or submission fails in
> stm32_fmc2_nfc_xfer(), the driver unmaps the data scatterlist without
> terminating the previously issued DMA descriptor. The descriptor may
> remain queued and execute when the next page operation starts,
> potentially writing into a buffer that has already been unmapped and
> returned to the NAND core. The timeout paths have a similar issue, as
> they use dmaengine_terminate_all(), which does not guarantee that DMA
> has stopped before the buffer is unmapped.
>
> Terminate the outstanding data descriptor on ECC error paths and use
> dmaengine_terminate_sync() on timeout paths, ensuring that DMA has
> stopped before the associated mapping is released.
>
> Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver")
> Assisted-by: LLM
> Signed-off-by: Samarth Narang <samarth.colleges at gmail.com>
Seems like you have a lot of them, so I'll drop the individual
submissions. Please create a series with all the ones related to the
subsystem you would like to contribute.
More information about the linux-arm-kernel
mailing list