mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amelie Delaunay <amelie.delaunay@foss.st.com>
To: Frank Li <Frank.li@oss.nxp.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>, Jerome Audu <jerome.audu@st.com>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH 1/4] dmaengine: stm32-dma3: clear flags before signaling transfer completion
Date: Mon, 23 Nov 2026 09:40:31 +0100	[thread overview]
Message-ID: <13394f16-8150-4631-a323-c88451c7f842@foss.st.com> (raw)
In-Reply-To: <awCH31i9i5mCRw9W@SMW015318>

On 11/20/26 18:48, Frank Li wrote:
> On Fri, Nov 20, 2026 at 10:18:01AM +0100, Amelie Delaunay wrote:
>> From: Jerome Audu<jerome.audu@st.com>
>>
>> On a Transfer Complete event, a new transfer can be started from
>> stm32_dma3_chan_complete(). The new transfer may finish while the end of
>> stm32_dma3_chan_irq() is still executing, in which case the flag clearing
>> done at the end of the handler also clears the new transfer's Transfer
>> Complete flag without the end of that transfer being handled, which may
>> lead to a timeout.
>>
>> Clear the flags before handling completion to make sure that if
>> stm32_dma3_chan_complete() starts an ultra-fast transfer, its TCF flag is
>> not accidentally cleared. This reordering is also safe for the other
>> handled interrupt conditions, since csr holds the channel status and is
>> used to select the handling path.
> Can you rephrase commit message. clean irq flags should just after
> get status before do actually handle. Actual handle may cause new irqs.
> 
> It is quite common pattern for irq handler.  Some thing like
> 
> Move clear irq state just after fetch state to avoid lost irq because
> actual handle work (i.e stm32_dma3_chan_complete()) may issue new irq.
> 
> Frank

Hi Frank,

Thanks for reviewing. I'll rephrase it, keeping the concrete failure 
scenario but making it shorter for clarity.

Regards,
Amelie


  reply	other threads:[~2026-11-23  8:40 UTC|newest]

Thread overview: 11+ 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-23  8:40     ` Amelie Delaunay [this message]
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
2026-11-20  9:18 ` [PATCH 3/4] dmaengine: stm32-dma3: validate LLI pool allocations and fix cleanup Amelie Delaunay
2026-11-20 18:02   ` Frank Li
2026-11-23  8:58     ` Amelie Delaunay
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=13394f16-8150-4631-a323-c88451c7f842@foss.st.com \
    --to=amelie.delaunay@foss.st.com \
    --cc=Frank.Li@kernel.org \
    --cc=Frank.li@oss.nxp.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jerome.audu@st.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®