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: <20251104042334.GA11714@nxa18884-linux.ap.freescale.net>
Date: Tue, 4 Nov 2025 12:24:12 +0800
From: Peng Fan <peng.fan@....nxp.com>
To: Frank Li <Frank.li@....com>
Cc: Peng Fan <peng.fan@....com>, 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>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Shengjiu Wang <shengjiu.wang@....com>,
	Daniel Baluta <daniel.baluta@....com>,
	Iuliana Prodan <iuliana.prodan@....com>,
	linux-remoteproc@...r.kernel.org, imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/11] remoteproc: imx_dsp_rproc: Use
 start/stop/detect_mode ops from imx_rproc_dcfg

On Fri, Oct 31, 2025 at 03:04:39PM -0400, Frank Li wrote:
>On Fri, Oct 31, 2025 at 05:08:35PM +0800, Peng Fan wrote:
>> Allow each platform to provide its own implementation of start/stop/
>> detect_mode operations, and prepare to eliminate the need for multiple
>> switch-case statements.
>>
>> Improve code readability and maintainability by encapsulating
>> platform-specific behavior.
>>
>> No functional changes.
>>
>> Signed-off-by: Peng Fan <peng.fan@....com>
>> ---
>>  drivers/remoteproc/imx_dsp_rproc.c | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
>> index 1726aaa1eafb9ac1a913e3e2caea73801b86dc09..833b1bd4019614157f0bedf09bd348caab802eef 100644
>> --- a/drivers/remoteproc/imx_dsp_rproc.c
>> +++ b/drivers/remoteproc/imx_dsp_rproc.c
>> @@ -404,6 +404,11 @@ static int imx_dsp_rproc_start(struct rproc *rproc)
>>  	struct device *dev = rproc->dev.parent;
>>  	int ret;
>>
>> +	if (dcfg->ops && dcfg->ops->start) {
>> +		ret = dcfg->ops->start(rproc);
>> +		goto start_ret;
>
>not sure if error message is important, maybe

I would like to keep the error message. Since this patch is just to prepare
for ops introducton, I would not change the original behavior. 

Thanks,
Peng

>
>		return dcfg->ops->start(rproc);
>
>Frank
>> +	}
>> +
>>  	switch (dcfg->method) {
>>  	case IMX_RPROC_MMIO:
>>  		ret = regmap_update_bits(priv->regmap,
>> @@ -424,6 +429,7 @@ static int imx_dsp_rproc_start(struct rproc *rproc)
>>  		return -EOPNOTSUPP;
>>  	}
>>
>> +start_ret:
>>  	if (ret)
>>  		dev_err(dev, "Failed to enable remote core!\n");
>>  	else if (priv->flags & WAIT_FW_READY)
>> @@ -449,6 +455,11 @@ static int imx_dsp_rproc_stop(struct rproc *rproc)
>>  		return 0;
>>  	}
>>
>> +	if (dcfg->ops && dcfg->ops->stop) {
>> +		ret = dcfg->ops->stop(rproc);
>> +		goto stop_ret;
>> +	}
>> +
>>  	switch (dcfg->method) {
>>  	case IMX_RPROC_MMIO:
>>  		ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask,
>> @@ -467,6 +478,7 @@ static int imx_dsp_rproc_stop(struct rproc *rproc)
>>  		return -EOPNOTSUPP;
>>  	}
>>
>> +stop_ret:
>>  	if (ret)
>>  		dev_err(dev, "Failed to stop remote core\n");
>>  	else
>> @@ -1085,10 +1097,14 @@ static int imx_dsp_attach_pm_domains(struct imx_dsp_rproc *priv)
>>  static int imx_dsp_rproc_detect_mode(struct imx_dsp_rproc *priv)
>>  {
>>  	const struct imx_dsp_rproc_dcfg *dsp_dcfg = priv->dsp_dcfg;
>> +	const struct imx_rproc_dcfg *dcfg = dsp_dcfg->dcfg;
>>  	struct device *dev = priv->rproc->dev.parent;
>>  	struct regmap *regmap;
>>  	int ret = 0;
>>
>> +	if (dcfg->ops && dcfg->ops->detect_mode)
>> +		return dcfg->ops->detect_mode(priv->rproc);
>> +
>>  	switch (dsp_dcfg->dcfg->method) {
>>  	case IMX_RPROC_SCU_API:
>>  		ret = imx_scu_get_handle(&priv->ipc_handle);
>>
>> --
>> 2.37.1
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ