lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMrHCEwWUEiheyiL@lizhi-Precision-Tower-5810>
Date: Wed, 17 Sep 2025 10:34:48 -0400
From: Frank Li <Frank.li@....com>
To: Peng Fan <peng.fan@....com>
Cc: Bjorn Andersson <andersson@...nel.org>,
	Mathieu Poirier <mathieu.poirier@...aro.org>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Hiago De Franco <hiago.franco@...adex.com>,
	linux-remoteproc@...r.kernel.org, imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] remoteproc: imx_rproc: Use
 devm_add_action_or_reset() for workqueue cleanup

On Wed, Sep 17, 2025 at 09:19:14PM +0800, Peng Fan wrote:
> Replace manual destroy_workqueue() calls in error and remove paths with a
> devm_add_action_or_reset() helper. Ensure the workqueue is properly
> cleaned up with the device lifecycle, and simplify error handling in probe
> by removing now-unnecessary labels and cleanup steps.
>
> No functional changes.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
Reviewed-by: Frank Li <Frank.Li@....com>

>  drivers/remoteproc/imx_rproc.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index 12305f36552fb5265b0953a099ea0d561880e3ff..cc776f5d75f1f614943c05250877f17537837068 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -1046,6 +1046,13 @@ static int imx_rproc_sys_off_handler(struct sys_off_data *data)
>  	return NOTIFY_DONE;
>  }
>
> +static void imx_rproc_destroy_workqueue(void *data)
> +{
> +	struct workqueue_struct *workqueue = data;
> +
> +	destroy_workqueue(workqueue);
> +}
> +
>  static void imx_rproc_pm_runtime_put(void *data)
>  {
>  	struct device *dev = data;
> @@ -1084,11 +1091,15 @@ static int imx_rproc_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>
> +	ret = devm_add_action_or_reset(dev, imx_rproc_destroy_workqueue, priv->workqueue);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to add devm destroy workqueue action\n");
> +
>  	INIT_WORK(&priv->rproc_work, imx_rproc_vq_work);
>
>  	ret = imx_rproc_xtr_mbox_init(rproc, true);
>  	if (ret)
> -		goto err_put_wkq;
> +		return ret;
>
>  	ret = imx_rproc_addr_init(priv, pdev);
>  	if (ret) {
> @@ -1165,8 +1176,6 @@ static int imx_rproc_probe(struct platform_device *pdev)
>  	imx_rproc_put_scu(rproc);
>  err_put_mbox:
>  	imx_rproc_free_mbox(rproc);
> -err_put_wkq:
> -	destroy_workqueue(priv->workqueue);
>
>  	return ret;
>  }
> @@ -1180,7 +1189,6 @@ static void imx_rproc_remove(struct platform_device *pdev)
>  	rproc_del(rproc);
>  	imx_rproc_put_scu(rproc);
>  	imx_rproc_free_mbox(rproc);
> -	destroy_workqueue(priv->workqueue);
>  }
>
>  static const struct imx_rproc_plat_ops imx_rproc_ops_arm_smc = {
>
> --
> 2.37.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ