From: Frank Li <Frank.li@oss.nxp.com>
To: Tian Xuechen <202300460064@mail.sdu.edu.cn>
Cc: vkoul@kernel.org, Frank.Li@kernel.org, dmaengine@vger.kernel.org,
robh@kernel.org, saravanak@kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/7] dmaengine: of: Add managed DMA router registration
Date: Fri, 4 Dec 2026 11:54:40 -0600 [thread overview]
Message-ID: <axL-YITkaZ3VOz_J@SMW015318> (raw)
In-Reply-To: <20261204121630.1720746-2-202300460064@mail.sdu.edu.cn>
On Fri, Dec 04, 2026 at 08:16:24PM +0800, Tian Xuechen wrote:
> Add devm_of_dma_router_register() to unregister an OF DMA router
> when its device is detached. Reuse the controller release action
> because controllers and routers share the same registry.
>
> Install the release action before publishing the router so allocating
> the action cannot fail after publication. If router registration
> fails, remove the unused action.
>
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---
I remember I reviewed this patch. Did you missed my review tags.
And also missed Vladimir Zapolskiy's review tags.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> include/linux/of_dma.h | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h
> index 16b08234d..df200c0cb 100644
> --- a/include/linux/of_dma.h
> +++ b/include/linux/of_dma.h
> @@ -64,6 +64,25 @@ extern int of_dma_router_register(struct device_node *np,
> struct dma_router *dma_router);
> #define of_dma_router_free of_dma_controller_free
>
> +static inline int
> +devm_of_dma_router_register(struct device *dev, struct device_node *np,
> + void *(*of_dma_route_allocate)
> + (struct of_phandle_args *, struct of_dma *),
> + struct dma_router *dma_router)
> +{
> + int ret;
> +
> + ret = devm_add_action(dev, __of_dma_controller_free, np);
> + if (ret)
> + return ret;
> +
> + ret = of_dma_router_register(np, of_dma_route_allocate, dma_router);
> + if (ret)
> + devm_remove_action(dev, __of_dma_controller_free, np);
> +
> + return ret;
> +}
> +
> extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
> const char *name);
> extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
> @@ -103,6 +122,15 @@ static inline int of_dma_router_register(struct device_node *np,
>
> #define of_dma_router_free of_dma_controller_free
>
> +static inline int
> +devm_of_dma_router_register(struct device *dev, struct device_node *np,
> + void *(*of_dma_route_allocate)
> + (struct of_phandle_args *, struct of_dma *),
> + struct dma_router *dma_router)
> +{
> + return -ENODEV;
> +}
> +
> static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
> const char *name)
> {
next prev parent reply other threads:[~2026-12-04 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 12:16 [PATCH v3 0/7] dmaengine: Manage OF DMA routers and disable STM32 unbind Tian Xuechen
2026-12-04 12:16 ` [PATCH v3 1/7] dmaengine: of: Add managed DMA router registration Tian Xuechen
2026-12-04 17:54 ` Frank Li [this message]
2026-12-04 12:16 ` [PATCH v3 2/7] dmaengine: lpc18xx-dmamux: Use " Tian Xuechen
2026-12-04 12:16 ` [PATCH v3 3/7] dmaengine: lpc32xx-dmamux: " Tian Xuechen
2026-12-04 12:16 ` [PATCH v3 4/7] dmaengine: dw: dmamux: " Tian Xuechen
2026-12-04 17:55 ` Frank Li
2026-12-04 12:16 ` [PATCH v3 5/7] dmaengine: stm32: Disable manual bind and unbind Tian Xuechen
2026-12-04 17:56 ` Frank Li
2026-12-04 12:16 ` [PATCH v3 6/7] dmaengine: stm32-dmamux: Use managed DMA router registration Tian Xuechen
2026-12-04 17:57 ` Frank Li
2026-12-04 12:16 ` [PATCH v3 7/7] dmaengine: ti-dma-crossbar: " Tian Xuechen
2026-12-04 17:57 ` Frank Li
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=axL-YITkaZ3VOz_J@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=202300460064@mail.sdu.edu.cn \
--cc=Frank.Li@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@kernel.org \
--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