mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Jiale Yao <yaojiale02@163.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Ryan Mallon <rmallon@gmail.com>,
	Mika Westerberg <mika.westerberg@iki.fi>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] dmaengine: ep93xx: drain tasklet before freeing channel resources
Date: Fri, 13 Nov 2026 15:37:48 -0500	[thread overview]
Message-ID: <avd1HMdPWhSk-FST@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20261018040724.534641-2-yaojiale02@163.com>

On Sun, Oct 18, 2026 at 12:07:17PM +0800, Jiale Yao wrote:
> The DMA interrupt handler can schedule the channel tasklet. Releasing
> the IRQ waits for a running interrupt handler, but it does not drain a
> tasklet that was already queued.
>
> The channel resource release path frees the software descriptors and
> disables the clock while such a tasklet can still access the channel and
> invoke a completion callback.
>
> Free the IRQ first to stop new tasklet producers, then kill the tasklet
> before releasing the descriptors and clock.
>
> Fixes: 5fa29a17fabf ("dmaengine: add ep93xx DMA support")
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/ep93xx_dma.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 311e55a97ba9..6134e9ca699d 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -1015,11 +1015,13 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan)
>  	list_splice_init(&edmac->free_list, &list);
>  	spin_unlock_irqrestore(&edmac->lock, flags);
>
> +	free_irq(edmac->irq, edmac);
> +	tasklet_kill(&edmac->tasklet);
> +
>  	list_for_each_entry_safe(desc, d, &list, node)
>  		kfree(desc);
>
>  	clk_disable_unprepare(edmac->clk);
> -	free_irq(edmac->irq, edmac);
>  }
>
>  /**
> --
> 2.34.1
>

  reply	other threads:[~2026-11-13 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18  4:07 [PATCH 0/7] dmaengine: drain completion tasklets during teardown Jiale Yao
2026-10-18  4:07 ` [PATCH 1/7] dmaengine: ep93xx: drain tasklet before freeing channel resources Jiale Yao
2026-11-13 20:37   ` Frank Li [this message]
2026-10-18  4:07 ` [PATCH 2/7] dmaengine: fsldma: drain channel tasklet during removal Jiale Yao
2026-11-13 20:38   ` Frank Li
2026-10-18  4:07 ` [PATCH 3/7] dmaengine: mmp_pdma: drain channel tasklets " Jiale Yao
2026-11-13 20:38   ` Frank Li
2026-10-18  4:07 ` [PATCH 4/7] dmaengine: mmp_tdma: synchronize tasklet when freeing a channel Jiale Yao
2026-10-18  4:07 ` [PATCH 5/7] dmaengine: mv_xor: drain IRQ tasklet before freeing channel memory Jiale Yao
2026-11-13 20:40   ` Frank Li
2026-10-18  4:07 ` [PATCH 6/7] dmaengine: mxs-dma: synchronize tasklet when freeing a channel Jiale Yao
2026-11-13 20:41   ` Frank Li
2026-10-18  4:07 ` [PATCH 7/7] dmaengine: ste_dma40: synchronize tasklet when releasing " Jiale Yao
2026-10-18 21:00   ` Linus Walleij
2026-11-13 20:41   ` Frank Li
2026-10-20  7:36 ` [PATCH 0/7] dmaengine: drain completion tasklets during teardown Peng Fan (OSS)
2026-10-20  8:10   ` jiale yao

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=avd1HMdPWhSk-FST@lizhi-Precision-Tower-5810 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@iki.fi \
    --cc=rmallon@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=yaojiale02@163.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 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®