All of lore.kernel.org
 help / color / mirror / Atom feed
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,
	vigneshr@ti.com, peter.ujfalusi@ti.com, grygorii.strashko@ti.com
Subject: Re: [PATCH v3 7/7] dmaengine: ti-dma-crossbar: Use managed DMA router registration
Date: Fri, 4 Dec 2026 11:57:41 -0600	[thread overview]
Message-ID: <axL_FdjerCGKhqkr@SMW015318> (raw)
In-Reply-To: <20261204121630.1720746-8-202300460064@mail.sdu.edu.cn>

On Fri, Dec 04, 2026 at 08:16:30PM +0800, Tian Xuechen wrote:
> The AM335x/AM43xx and DRA7x probe paths register OF DMA routers backed
> by managed driver data. Their registry entries can outlive that data
> when the device is detached.
>
> Use devm_of_dma_router_register() for both probe paths so devres
> withdraws the entries before releasing their backing data. Preserve
> the DRA7x register reset on registration failure.
>
> Fixes: a074ae38f859 ("dmaengine: Add driver for TI DMA crossbar on DRA7x")
> Fixes: 42dbdcc6bf96 ("dmaengine: ti-dma-crossbar: Add support for crossbar on AM33xx/AM43xx")
> Cc: stable+noautosel@kernel.org # relies on new API
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---
>  drivers/dma/ti/dma-crossbar.c | 10 ++++++----

Reviewed-by: Frank Li <Frank.Li@nxp.com>


>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c
> index f6d75ee94..87a728c48 100644
> --- a/drivers/dma/ti/dma-crossbar.c
> +++ b/drivers/dma/ti/dma-crossbar.c
> @@ -192,8 +192,9 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev)
>  	for (i = 0; i < xbar->dma_requests; i++)
>  		ti_am335x_xbar_write(xbar->iomem, i, 0);
>
> -	ret = of_dma_router_register(node, ti_am335x_xbar_route_allocate,
> -				     &xbar->dmarouter);
> +	ret = devm_of_dma_router_register(&pdev->dev, node,
> +					  ti_am335x_xbar_route_allocate,
> +					  &xbar->dmarouter);
>
>  	return ret;
>  }
> @@ -430,8 +431,9 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
>  			ti_dra7_xbar_write(xbar->iomem, i, xbar->safe_val);
>  	}
>
> -	ret = of_dma_router_register(node, ti_dra7_xbar_route_allocate,
> -				     &xbar->dmarouter);
> +	ret = devm_of_dma_router_register(&pdev->dev, node,
> +					  ti_dra7_xbar_route_allocate,
> +					  &xbar->dmarouter);
>  	if (ret) {
>  		/* Restore the defaults for the crossbar */
>  		for (i = 0; i < xbar->dma_requests; i++) {

      reply	other threads:[~2026-12-04 17:57 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
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 [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=axL_FdjerCGKhqkr@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=202300460064@mail.sdu.edu.cn \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=vigneshr@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.