From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Samarth Narang <samarth.colleges@gmail.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: stm32_fmc2: retire data DMA before unmapping on errors
Date: Fri, 30 Oct 2026 16:30:01 +0100 [thread overview]
Message-ID: <87tsm3cikm.fsf@bootlin.com> (raw)
In-Reply-To: <20261030151843.2953269-1-samarth.colleges@gmail.com> (Samarth Narang's message of "Fri, 30 Oct 2026 15:18:43 +0000")
On 30/10/2026 at 15:18:43 GMT, Samarth Narang <samarth.colleges@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@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.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Samarth Narang <samarth.colleges@gmail.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: stm32_fmc2: retire data DMA before unmapping on errors
Date: Fri, 30 Oct 2026 16:30:01 +0100 [thread overview]
Message-ID: <87tsm3cikm.fsf@bootlin.com> (raw)
In-Reply-To: <20261030151843.2953269-1-samarth.colleges@gmail.com> (Samarth Narang's message of "Fri, 30 Oct 2026 15:18:43 +0000")
On 30/10/2026 at 15:18:43 GMT, Samarth Narang <samarth.colleges@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@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.
next prev parent reply other threads:[~2026-10-30 15:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 15:18 [PATCH] mtd: rawnand: stm32_fmc2: retire data DMA before unmapping on errors Samarth Narang
2026-10-30 15:18 ` Samarth Narang
2026-10-30 15:30 ` Miquel Raynal [this message]
2026-10-30 15:30 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tsm3cikm.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=richard@nod.at \
--cc=samarth.colleges@gmail.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.