From: Frank Li <Frank.li@oss.nxp.com>
To: Amelie Delaunay <amelie.delaunay@foss.st.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
dmaengine@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/4] dmaengine: stm32-dma3: set LL base address when transfer starts
Date: Fri, 20 Nov 2026 11:51:14 -0600 [thread overview]
Message-ID: <awCIko2GXV_rzIRc@SMW015318> (raw)
In-Reply-To: <20261120-dma3-fixes-v1-2-f29c1f437399@foss.st.com>
On Fri, Nov 20, 2026 at 10:18:02AM +0100, Amelie Delaunay wrote:
> Linked-list (LL) is allocated in stm32_dma3_chan_desc_alloc(). The LL is
> then used when starting the transfer in stm32_dma3_chan_start(). Nothing
> prevents a user from preparing another transfer before starting the
> previous one. If, for the same channel, another kind of transfer is
> prepared (using dmaengine_prep_xxx API), the LL base address may change.
> This address could be overwritten in the CxLBAR register if the channel is
> disabled, or the CxLBAR might not be updated if the channel is enabled,
> leading to a mismatch between the transfer being started and the LL pointed
> to by CxLBAR register.
Nit: Add emtpy line between parapragh
> To avoid this, write the LL base address in CxLBAR when starting the
> transfer instead of when the linked-list is allocated.
>
> Fixes: f561ec8b2b33 ("dmaengine: Add STM32 DMA3 support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/stm32/stm32-dma3.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/stm32/stm32-dma3.c b/drivers/dma/stm32/stm32-dma3.c
> index a464e0cefd64..a056f73fbe02 100644
> --- a/drivers/dma/stm32/stm32-dma3.c
> +++ b/drivers/dma/stm32/stm32-dma3.c
> @@ -396,7 +396,6 @@ static void stm32_dma3_chan_dump_hwdesc(struct stm32_dma3_chan *chan,
>
> static struct stm32_dma3_swdesc *stm32_dma3_chan_desc_alloc(struct stm32_dma3_chan *chan, u32 count)
> {
> - struct stm32_dma3_ddata *ddata = to_stm32_dma3_ddata(chan);
> struct stm32_dma3_swdesc *swdesc;
> int i;
>
> @@ -423,10 +422,6 @@ static struct stm32_dma3_swdesc *stm32_dma3_chan_desc_alloc(struct stm32_dma3_ch
> }
> swdesc->ccr = 0;
>
> - /* Set LL base address */
> - writel_relaxed(swdesc->lli[0].hwdesc_addr & CLBAR_LBA,
> - ddata->base + STM32_DMA3_CLBAR(chan->id));
> -
> /* Set LL allocated port */
> swdesc->ccr &= ~CCR_LAP;
>
> @@ -790,6 +785,10 @@ static void stm32_dma3_chan_start(struct stm32_dma3_chan *chan)
> writel_relaxed(hwdesc->cdar, ddata->base + STM32_DMA3_CDAR(id));
> writel_relaxed(hwdesc->cllr, ddata->base + STM32_DMA3_CLLR(id));
>
> + /* Set LL base address */
> + writel_relaxed(chan->swdesc->lli[0].hwdesc_addr & CLBAR_LBA,
> + ddata->base + STM32_DMA3_CLBAR(chan->id));
> +
> /* Clear any pending interrupts */
> csr = readl_relaxed(ddata->base + STM32_DMA3_CSR(id));
> if (csr & CSR_ALL_F)
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-11-20 17:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 9:18 [PATCH 0/4] dmaengine: stm32-dma3: fix IRQ flag race and linked-list handling Amelie Delaunay
2026-11-20 9:18 ` [PATCH 1/4] dmaengine: stm32-dma3: clear flags before signaling transfer completion Amelie Delaunay
2026-11-20 17:48 ` Frank Li
2026-11-20 9:18 ` [PATCH 2/4] dmaengine: stm32-dma3: set LL base address when transfer starts Amelie Delaunay
2026-11-20 17:51 ` Frank Li [this message]
2026-11-20 9:18 ` [PATCH 3/4] dmaengine: stm32-dma3: validate LLI pool allocations and fix cleanup Amelie Delaunay
2026-11-20 9:24 ` sashiko-bot
2026-11-20 18:02 ` Frank Li
2026-11-20 9:18 ` [PATCH 4/4] dmaengine: stm32-dma3: replace hardcoded LLI size with aligned descriptor size Amelie Delaunay
2026-11-20 18:05 ` Frank Li
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=awCIko2GXV_rzIRc@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=amelie.delaunay@foss.st.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/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.