From: Frank Li <Frank.li@oss.nxp.com>
To: Tian Xuechen <202300460064@mail.sdu.edu.cn>
Cc: vkoul@kernel.org, alex@sverdlin.org, nikita.shubin@maquefel.me,
arnd@arndb.de, Frank.Li@kernel.org, dmaengine@vger.kernel.org,
liguangshuo@mail.sdu.edu.cn
Subject: Re: [PATCH] dmaengine: ep93xx: Withdraw the DMA providers on removal
Date: Tue, 1 Dec 2026 13:41:38 -0600 [thread overview]
Message-ID: <aw8i8ioNrRMoRliI@SMW015318> (raw)
In-Reply-To: <20261128110227.875382-1-202300460064@mail.sdu.edu.cn>
On Sat, Nov 28, 2026 at 07:02:27PM +0800, Tian Xuechen wrote:
> From: Tian Xuechen <202300460064@mail.sdu.edu.cn>
>
> The OF controller and DMA engine are still registered when devres
> releases their channel data. Manage both registrations so the OF
> controller is withdrawn first, followed by the DMA engine.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 2e7f55ce4302 ("dmaengine: cirrus: Convert to DT for Cirrus EP93xx")
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/ep93xx_dma.c | 19 +++++--------------
> 1 file changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> index 8a0b66a7d886..dc11cf740edf 100644
> --- a/drivers/dma/ep93xx_dma.c
> +++ b/drivers/dma/ep93xx_dma.c
> @@ -1539,28 +1539,19 @@ static int ep93xx_dma_probe(struct platform_device *pdev)
> edma->hw_interrupt = m2p_hw_interrupt;
> }
>
> - ret = dma_async_device_register(dma_dev);
> + ret = dmaenginem_async_device_register(dma_dev);
> if (ret)
> return ret;
>
> - if (edma->m2m) {
> - ret = of_dma_controller_register(pdev->dev.of_node, ep93xx_m2m_dma_of_xlate,
> - edma);
> - } else {
> - ret = of_dma_controller_register(pdev->dev.of_node, ep93xx_m2p_dma_of_xlate,
> - edma);
> - }
> + ret = devm_of_dma_controller_register(&pdev->dev, pdev->dev.of_node,
> + edma->m2m ? ep93xx_m2m_dma_of_xlate :
> + ep93xx_m2p_dma_of_xlate, edma);
> if (ret)
> - goto err_dma_unregister;
> + return ret;
>
> dev_info(dma_dev->dev, "EP93xx M2%s DMA ready\n", edma->m2m ? "M" : "P");
>
> return 0;
> -
> -err_dma_unregister:
> - dma_async_device_unregister(dma_dev);
> -
> - return ret;
> }
>
> static const struct ep93xx_edma_data edma_m2p = {
>
> base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
> --
> 2.43.0
>
prev parent reply other threads:[~2026-12-01 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 11:02 [PATCH] dmaengine: ep93xx: Withdraw the DMA providers on removal Tian Xuechen
2026-12-01 19:29 ` Alexander Sverdlin
2026-12-01 19:41 ` 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=aw8i8ioNrRMoRliI@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=202300460064@mail.sdu.edu.cn \
--cc=Frank.Li@kernel.org \
--cc=alex@sverdlin.org \
--cc=arnd@arndb.de \
--cc=dmaengine@vger.kernel.org \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=nikita.shubin@maquefel.me \
--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