* [PATCH] dmaengine: mcf-edma: unregister DMA device before vchan cleanup
@ 2026-11-03 15:33 Peng Fan (OSS)
2026-11-13 19:36 ` Frank Li
0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-11-03 15:33 UTC (permalink / raw)
To: Vinod Koul, Frank Li, Angelo Dureghello; +Cc: dmaengine, linux-kernel, Peng Fan
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>
---
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: mcf-edma: unregister DMA device before vchan cleanup
2026-11-03 15:33 [PATCH] dmaengine: mcf-edma: unregister DMA device before vchan cleanup Peng Fan (OSS)
@ 2026-11-13 19:36 ` Frank Li
0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-11-13 19:36 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Vinod Koul, Frank Li, Angelo Dureghello, dmaengine, linux-kernel,
Peng Fan
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>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-13 19:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 15:33 [PATCH] dmaengine: mcf-edma: unregister DMA device before vchan cleanup Peng Fan (OSS)
2026-11-13 19:36 ` Frank Li
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®