]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dmaengine: fsl-edma: cleanup chan after dma_async_device_unregister
authorPeng Fan <peng.fan@nxp.com>
Fri, 28 Feb 2025 07:17:19 +0000 (15:17 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 10 Mar 2025 20:53:37 +0000 (02:23 +0530)
commitc9c59da76ce9cb3f215b66eb3708cda1134a5206
tree0fa8aca0e8b43ca01f062efcab66f5508beef83b
parent6ec29d4086ed8b951fa794ac6c0e7cd7ae3762d9
dmaengine: fsl-edma: cleanup chan after dma_async_device_unregister

There is kernel dump when do module test:
sysfs: cannot create duplicate filename
/devices/platform/soc@0/44000000.bus/44000000.dma-controller/dma/dma0chan0
 __dma_async_device_channel_register+0x128/0x19c
 dma_async_device_register+0x150/0x454
 fsl_edma_probe+0x6cc/0x8a0
 platform_probe+0x68/0xc8

fsl_edma_cleanup_vchan will unlink vchan.chan.device_node, while
dma_async_device_unregister  needs the link to do
__dma_async_device_channel_unregister. So need move fsl_edma_cleanup_vchan
after dma_async_device_unregister to make sure channel could be freed.

So clean up chan after dma_async_device_unregister to address this.

Fixes: 6f93b93b2a1b ("dmaengine: fsl-edma: kill the tasklets upon exit")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20250228071720.3780479-1-peng.fan@oss.nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/fsl-edma-main.c