mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Angelo Dureghello <angelo@sysam.it>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH] dmaengine: mcf-edma: unregister DMA device before vchan cleanup
Date: Fri, 13 Nov 2026 14:36:58 -0500	[thread overview]
Message-ID: <avdm2rtTa4P80ypi@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20261103-mcf-edma-v1-1-f6acbc569fc1@nxp.com>

On Tue, Nov 03, 2026 at 11:33:24PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> mcf_edma_remove() calls fsl_edma_cleanup_vchan() before
> dma_async_device_unregister().  The cleanup helper removes every
> channel from dma_dev.channels, so dma_async_device_unregister() later
> sees an empty list and never unregisters the channel devices.
>
> This leaves dmaNchanM devices in sysfs, keeps their IOMMU groups alive
> and skips freeing the channel IDs and per-channel state when the
> controller is unbound or the driver is removed.
>
> Unregister the DMA device first, then run the vchan cleanup so the
> channel list is still intact when dma_async_device_unregister()
> iterates it.
>
> Fixes: e7a3ff92eaf19eab14e8149758428e680c61706b ("dmaengine: fsl-edma: add ColdFire mcf5441x edma support")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---

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

>  drivers/dma/mcf-edma-main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
> index 9e1c6400c77b..2efd5f0b4f87 100644
> --- a/drivers/dma/mcf-edma-main.c
> +++ b/drivers/dma/mcf-edma-main.c
> @@ -258,8 +258,8 @@ static void mcf_edma_remove(struct platform_device *pdev)
>  	struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev);
>
>  	mcf_edma_irq_free(pdev, mcf_edma);
> -	fsl_edma_cleanup_vchan(&mcf_edma->dma_dev);
>  	dma_async_device_unregister(&mcf_edma->dma_dev);
> +	fsl_edma_cleanup_vchan(&mcf_edma->dma_dev);
>  }
>
>  static struct platform_driver mcf_edma_driver = {
>
> ---
> base-commit: d6bcfc94eb4da6e089c5473970cd96727292fd97
> change-id: 20261103-mcf-edma-c7a06df69dbd
>
> Best regards,
> --
> Peng Fan <peng.fan@nxp.com>
>

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:33 Peng Fan (OSS)
2026-11-13 19:36 ` Frank Li [this message]

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=avdm2rtTa4P80ypi@lizhi-Precision-Tower-5810 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=angelo@sysam.it \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --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®