All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-remoteproc@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
	Frank Li <Frank.Li@nxp.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Shengjiu Wang <shengjiu.wang@nxp.com>
Subject: Re: [PATCH v3 01/11] remoteproc: imx_dsp_rproc: simplify power domain attach and error handling
Date: Tue, 18 Nov 2025 09:39:52 -0700	[thread overview]
Message-ID: <aRyhWF5Wh5GxXsCg@p14s> (raw)
In-Reply-To: <20251111-imx-dsp-2025-11-11-v3-1-d05dcba737fa@nxp.com>

On Tue, Nov 11, 2025 at 09:41:12AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Refactor imx_dsp_attach_pm_domains() to use devm_pm_domain_attach_list()
> directly, removing manual detach logic and simplifying resource management.
> 
> Also replace verbose error handling in imx_dsp_rproc_probe() with
> dev_err_probe() for cleaner and more consistent error reporting.
> 
> No functional changes.
> 
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/remoteproc/imx_dsp_rproc.c | 29 ++++++++---------------------
>  1 file changed, 8 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
> index 6e78a01755c7bdc28cd93f00fe6f74affc3d96b0..c466363debbebe8f91b908b3bffaa32e9bf8b9a6 100644
> --- a/drivers/remoteproc/imx_dsp_rproc.c
> +++ b/drivers/remoteproc/imx_dsp_rproc.c
> @@ -1062,14 +1062,12 @@ static const struct rproc_ops imx_dsp_rproc_ops = {
>  static int imx_dsp_attach_pm_domains(struct imx_dsp_rproc *priv)
>  {
>  	struct device *dev = priv->rproc->dev.parent;
> -	int ret;
>  
>  	/* A single PM domain is already attached. */
>  	if (dev->pm_domain)
>  		return 0;
>  
> -	ret = dev_pm_domain_attach_list(dev, NULL, &priv->pd_list);
> -	return ret < 0 ? ret : 0;
> +	return devm_pm_domain_attach_list(dev, NULL, &priv->pd_list);
>  }
>  
>  /**
> @@ -1186,35 +1184,25 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev)
>  
>  	/* There are multiple power domains required by DSP on some platform */
>  	ret = imx_dsp_attach_pm_domains(priv);
> -	if (ret) {
> -		dev_err(dev, "failed on imx_dsp_attach_pm_domains\n");
> -		return ret;
> -	}
> +	if (ret < 0)
> +		return dev_err_probe(dev, ret, "failed on imx_dsp_attach_pm_domains\n");
> +
>  	/* Get clocks */
>  	ret = imx_dsp_rproc_clk_get(priv);
> -	if (ret) {
> -		dev_err(dev, "failed on imx_dsp_rproc_clk_get\n");
> -		goto err_detach_domains;
> -	}
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed on imx_dsp_rproc_clk_get\n");
>  
>  	init_completion(&priv->pm_comp);
>  	rproc->auto_boot = false;
>  	ret = rproc_add(rproc);
> -	if (ret) {
> -		dev_err(dev, "rproc_add failed\n");
> -		goto err_detach_domains;
> -	}
> +	if (ret)
> +		return dev_err_probe(dev, ret, "rproc_add failed\n");
>  
>  	rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_XTENSA);
>  
>  	pm_runtime_enable(dev);
>  
>  	return 0;
> -
> -err_detach_domains:
> -	dev_pm_domain_detach_list(priv->pd_list);
> -
> -	return ret;
>  }
>  
>  static void imx_dsp_rproc_remove(struct platform_device *pdev)
> @@ -1224,7 +1212,6 @@ static void imx_dsp_rproc_remove(struct platform_device *pdev)
>  
>  	pm_runtime_disable(&pdev->dev);
>  	rproc_del(rproc);
> -	dev_pm_domain_detach_list(priv->pd_list);

This patch is giving me a compilation warning.

>  }
>  
>  /* pm runtime functions */
> 
> -- 
> 2.37.1
> 

  reply	other threads:[~2025-11-18 16:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11  1:41 [PATCH v3 00/11] remoteproc: imx_dsp_rproc: Refactor to use new ops and remove switch-case logic Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 01/11] remoteproc: imx_dsp_rproc: simplify power domain attach and error handling Peng Fan (OSS)
2025-11-18 16:39   ` Mathieu Poirier [this message]
2025-11-11  1:41 ` [PATCH v3 02/11] remoteproc: imx_dsp_rproc: Use devm_rproc_add() helper Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 03/11] remoteproc: imx_dsp_rproc: Use devm_pm_runtime_enable() helper Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 04/11] remoteproc: imx_dsp_rproc: Use dev_err_probe() for firmware and mode errors Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 05/11] remoteproc: imx_dsp_rproc: Drop extra space Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 06/11] remoteproc: imx_dsp_rproc: Use start/stop/detect_mode ops from imx_rproc_dcfg Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 07/11] remoteproc: imx_dsp_rproc: Move imx_dsp_rproc_dcfg closer to imx_dsp_rproc_of_match Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 08/11] remoteproc: imx_dsp_rproc: Simplify IMX_RPROC_MMIO switch case Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 09/11] remoteproc: imx_dsp_rproc: Simplify IMX_RPROC_SCU_API " Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 10/11] remoteproc: imx_dsp_rproc: Simplify IMX_RPROC_RESET_CONTROLLER " Peng Fan (OSS)
2025-11-11  1:41 ` [PATCH v3 11/11] remoteproc: imx_rproc: Remove enum imx_rproc_method Peng Fan (OSS)
2025-11-18 16:42   ` Mathieu Poirier
2025-11-19  4:29     ` Peng Fan (OSS)
2025-11-12  8:56 ` [PATCH v3 00/11] remoteproc: imx_dsp_rproc: Refactor to use new ops and remove switch-case logic Iuliana Prodan

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=aRyhWF5Wh5GxXsCg@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=Frank.Li@nxp.com \
    --cc=andersson@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    /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.