DMA Engine development
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal
@ 2026-11-29  9:47 Tian Xuechen
  2026-12-03 11:06 ` Miquel Raynal
  2026-12-03 16:33 ` Frank Li
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Xuechen @ 2026-11-29  9:47 UTC (permalink / raw)
  To: vireshk, vkoul, miquel.raynal, ilpo.jarvinen, andriy.shevchenko
  Cc: Frank.Li, dmaengine, liguangshuo

From: Tian Xuechen <202300460064@mail.sdu.edu.cn>

The RZ/N1 driver leaves its router in the OF DMA registry when the
device is unbound. Unregister the router before devres releases the
router data.

This issue was found by our static analysis tool under development.

Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
---
 drivers/dma/dw/rzn1-dmamux.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index ddcd111d57ee..a2b106eb27d5 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -149,6 +149,11 @@ static int rzn1_dmamux_probe(struct platform_device *pdev)
 				      &dmamux->dmarouter);
 }
 
+static void rzn1_dmamux_remove(struct platform_device *pdev)
+{
+	of_dma_router_free(pdev->dev.of_node);
+}
+
 static const struct of_device_id rzn1_dmamux_match[] = {
 	{ .compatible = "renesas,rzn1-dmamux" },
 	{}
@@ -161,6 +166,7 @@ static struct platform_driver rzn1_dmamux_driver = {
 		.of_match_table = rzn1_dmamux_match,
 	},
 	.probe	= rzn1_dmamux_probe,
+	.remove	= rzn1_dmamux_remove,
 };
 module_platform_driver(rzn1_dmamux_driver);
 

base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal
  2026-11-29  9:47 [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal Tian Xuechen
@ 2026-12-03 11:06 ` Miquel Raynal
  2026-12-03 16:33 ` Frank Li
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2026-12-03 11:06 UTC (permalink / raw)
  To: Tian Xuechen
  Cc: vireshk, vkoul, ilpo.jarvinen, andriy.shevchenko, Frank.Li,
	dmaengine, liguangshuo

On 29/11/2026 at 17:47:43 +08, Tian Xuechen <202300460064@mail.sdu.edu.cn> wrote:

> From: Tian Xuechen <202300460064@mail.sdu.edu.cn>
>
> The RZ/N1 driver leaves its router in the OF DMA registry when the
> device is unbound. Unregister the router before devres releases the
> router data.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal
  2026-11-29  9:47 [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal Tian Xuechen
  2026-12-03 11:06 ` Miquel Raynal
@ 2026-12-03 16:33 ` Frank Li
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-12-03 16:33 UTC (permalink / raw)
  To: Tian Xuechen
  Cc: vireshk, vkoul, miquel.raynal, ilpo.jarvinen, andriy.shevchenko,
	Frank.Li, dmaengine, liguangshuo

On Sun, Nov 29, 2026 at 05:47:43PM +0800, Tian Xuechen wrote:
> From: Tian Xuechen <202300460064@mail.sdu.edu.cn>
>
> The RZ/N1 driver leaves its router in the OF DMA registry when the
> device is unbound. Unregister the router before devres releases the
> router data.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---

Can you combine all your of_dma_router patches to prevous serial

https://patchwork.kernel.org/project/linux-dmaengine/patch/20261127110400.379397-2-202300460064@mail.sdu.edu.cn/

And use devm_of_dma_router_register()

Frank

>  drivers/dma/dw/rzn1-dmamux.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
> index ddcd111d57ee..a2b106eb27d5 100644
> --- a/drivers/dma/dw/rzn1-dmamux.c
> +++ b/drivers/dma/dw/rzn1-dmamux.c
> @@ -149,6 +149,11 @@ static int rzn1_dmamux_probe(struct platform_device *pdev)
>  				      &dmamux->dmarouter);
>  }
>
> +static void rzn1_dmamux_remove(struct platform_device *pdev)
> +{
> +	of_dma_router_free(pdev->dev.of_node);
> +}
> +
>  static const struct of_device_id rzn1_dmamux_match[] = {
>  	{ .compatible = "renesas,rzn1-dmamux" },
>  	{}
> @@ -161,6 +166,7 @@ static struct platform_driver rzn1_dmamux_driver = {
>  		.of_match_table = rzn1_dmamux_match,
>  	},
>  	.probe	= rzn1_dmamux_probe,
> +	.remove	= rzn1_dmamux_remove,
>  };
>  module_platform_driver(rzn1_dmamux_driver);
>
>
> base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-03 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  9:47 [PATCH] dmaengine: dw: dmamux: Unregister the RZ/N1 DMA router on removal Tian Xuechen
2026-12-03 11:06 ` Miquel Raynal
2026-12-03 16:33 ` Frank Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox