mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Lee Jones <lee@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Peter Pearse <peter.pearse@arm.com>,
	Linus Walleij <linusw@kernel.org>,
	Joachim Eastwood <manabian@gmail.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 01/11] dmaengine: pl08x: Defer OF DMA controller registration until slave setup
Date: Tue, 17 Nov 2026 14:37:02 -0500	[thread overview]
Message-ID: <avys3pO6oWcGwNN3@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20261117163809.622249-2-lee@kernel.org>

On Tue, Nov 17, 2026 at 04:37:02PM +0000, Lee Jones wrote:
> pl08x_of_probe() registers the controller with
> of_dma_controller_register() before pl08x_dma_init_virtual_channels()
> initialises the slave channels list and before
> dma_async_device_register() registers the slave DMA device, and
> pl08x_probe() does not unregister the OF DMA controller if subsequent
> initialisation fails.
>
> Move of_dma_controller_register() after dma_async_device_register() for
> the slave device and unwind slave device registration if OF controller
> registration fails.
>
> Fixes: aa4734da6674 ("dmaengine: pl08x: support dt channel assignment")
> Closes: https://sashiko.dev/#/bug/linux-4e233fb9-3b0c-4442-b601-c6706c9f5aba
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
>
> v1 => v2: No changes
>
>  drivers/dma/amba-pl08x.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index 543c2eb8cfa8..d8441e338502 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -2678,6 +2678,12 @@ static int pl08x_of_probe(struct amba_device *adev,
>
>  	pl08x->pd = pd;
>
> +	return 0;
> +}
> +
> +static int pl08x_of_register(struct amba_device *adev,
> +			     struct pl08x_driver_data *pl08x)
> +{
>  	return of_dma_controller_register(adev->dev.of_node, pl08x_of_xlate,
>  					  pl08x);
>  }
> @@ -2688,6 +2694,12 @@ static inline int pl08x_of_probe(struct amba_device *adev,
>  {
>  	return -EINVAL;
>  }
> +
> +static inline int pl08x_of_register(struct amba_device *adev,
> +				    struct pl08x_driver_data *pl08x)
> +{
> +	return 0;
> +}
>  #endif
>
>  static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
> @@ -2944,6 +2956,15 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
>  			__func__, ret);
>  			goto out_no_slave_reg;
>  		}
> +		if (np) {
> +			ret = pl08x_of_register(adev, pl08x);
> +			if (ret) {
> +				dev_warn(&pl08x->adev->dev,
> +					 "%s failed to register OF DMA controller - %d\n",
> +					 __func__, ret);
> +				goto out_no_of_dma;
> +			}
> +		}
>  	}
>
>  	amba_set_drvdata(adev, pl08x);
> @@ -2954,6 +2975,8 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
>
>  	return 0;
>
> +out_no_of_dma:
> +	dma_async_device_unregister(&pl08x->slave);
>  out_no_slave_reg:
>  	dma_async_device_unregister(&pl08x->memcpy);

It'd better switch to dmaenginem_async_device_register()

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

>  out_no_memcpy_reg:
> --
> 2.56.0.679.gc527c65306-goog
>

  parent reply	other threads:[~2026-11-17 19:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 16:37 [PATCH v2 00/11] dmaengine: Fix teardown races, resource leaks, and error handling Lee Jones
2026-11-17 16:37 ` [PATCH v2 01/11] dmaengine: pl08x: Defer OF DMA controller registration until slave setup Lee Jones
2026-11-17 18:44   ` Linus Walleij
2026-11-17 19:37   ` Frank Li [this message]
2026-11-17 16:37 ` [PATCH v2 02/11] dmaengine: ae4dma: Let the pending work exit before cancelling it Lee Jones
2026-11-17 19:38   ` Frank Li
2026-11-19  5:33   ` Basavaraj Natikar
2026-11-17 16:37 ` [PATCH v2 03/11] dmaengine: ae4dma: Unregister DMA engine in ae4_pci_remove() Lee Jones
2026-11-17 19:40   ` Frank Li
2026-11-19  5:36   ` Basavaraj Natikar
2026-11-17 16:37 ` [PATCH v2 04/11] dmaengine: ptdma: Unmap descriptor in pt_do_cleanup() Lee Jones
2026-11-17 19:41   ` Frank Li
2026-11-19  5:38   ` Basavaraj Natikar
2026-11-17 16:37 ` [PATCH v2 05/11] dmaengine: ptdma: Remove completed descriptor under vc.lock in pt_cmd_callback_work() Lee Jones
2026-11-17 19:42   ` Frank Li
2026-11-19  5:41   ` Basavaraj Natikar
2026-11-17 16:37 ` [PATCH v2 06/11] dmaengine: amlogic: Destroy free_wq after devres DMA device unregistration Lee Jones
2026-11-17 19:43   ` Frank Li
2026-11-17 16:37 ` [PATCH v2 07/11] dmaengine: arm-dma350: Query dma_cookie_status() under vc.lock in d350_tx_status() Lee Jones
2026-11-17 19:44   ` Frank Li
2026-11-17 16:37 ` [PATCH v2 08/11] dmaengine: bestcomm: Defer publishing bcom_eng until initialisation completes Lee Jones
2026-11-17 19:48   ` Frank Li
2026-11-17 16:37 ` [PATCH v2 09/11] dmaengine: bestcomm: Check rh_create() return value in bcom_sram_init() Lee Jones
2026-11-17 19:49   ` Frank Li
2026-11-17 16:37 ` [PATCH v2 10/11] dmaengine: jz4780: Fix descriptor cleanup on hwdesc setup failure Lee Jones
2026-11-17 19:50   ` Frank Li
2026-11-17 19:54   ` Paul Cercueil
2026-11-17 16:37 ` [PATCH v2 11/11] dmaengine: dmatest: Avoid unsigned underflow in min_odd() Lee Jones
2026-11-17 19:51   ` 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=avys3pO6oWcGwNN3@lizhi-Precision-Tower-5810 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=peter.pearse@arm.com \
    --cc=stable@vger.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

all inboxes | Powered by JetHome®