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: <20221012223216.GE1196937@p14s>
Date:   Wed, 12 Oct 2022 16:32:16 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc:     andersson@...nel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, linux-remoteproc@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Peng Fan <peng.fan@....com>
Subject: Re: [PATCH V6 7/7] remoteproc: imx_rproc: Enable attach recovery for
 i.MX8QM/QXP

On Thu, Sep 29, 2022 at 02:17:04PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
> 
> i.MX8QM/QXP M4 could recover without help from Linux, so to support it:
>  - enable feature RPROC_FEAT_ATTACH_ON_RECOVERY
>  - add detach hook
>  - Since we have detach callback, we could move the free mbox operation
>  from partition reset notify to detach callback.
> 
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
>  drivers/remoteproc/imx_rproc.c | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index bece44b46719..4057d6f33813 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -603,6 +603,22 @@ static int imx_rproc_attach(struct rproc *rproc)
>  	return imx_rproc_xtr_mbox_init(rproc);
>  }
>  
> +static int imx_rproc_detach(struct rproc *rproc)
> +{
> +	struct imx_rproc *priv = rproc->priv;
> +	const struct imx_rproc_dcfg *dcfg = priv->dcfg;
> +
> +	if (dcfg->method != IMX_RPROC_SCU_API)
> +		return -EOPNOTSUPP;
> +
> +	if (imx_sc_rm_is_resource_owned(priv->ipc_handle, priv->rsrc_id))
> +		return -EOPNOTSUPP;
> +
> +	imx_rproc_free_mbox(rproc);

Which is exactly what you did here.

I really don't understand what you did in patch 6/7...  Anyways, I suggest to
add support for the detached scenario and then fix the mailbox corruption
problem.

I am done reviewing this set.

> +
> +	return 0;
> +}
> +
>  static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
>  {
>  	struct imx_rproc *priv = rproc->priv;
> @@ -618,6 +634,7 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc
>  static const struct rproc_ops imx_rproc_ops = {
>  	.prepare	= imx_rproc_prepare,
>  	.attach		= imx_rproc_attach,
> +	.detach		= imx_rproc_detach,
>  	.start		= imx_rproc_start,
>  	.stop		= imx_rproc_stop,
>  	.kick		= imx_rproc_kick,
> @@ -797,8 +814,6 @@ static int imx_rproc_partition_notify(struct notifier_block *nb,
>  	if (!((event & BIT(priv->rproc_pt)) && (*(u8 *)group == IMX_SC_IRQ_GROUP_REBOOTED)))
>  		return 0;
>  
> -	imx_rproc_free_mbox(priv->rproc);
> -
>  	rproc_report_crash(priv->rproc, RPROC_WATCHDOG);
>  
>  	pr_info("Partition%d reset!\n", priv->rproc_pt);
> @@ -916,7 +931,8 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
>  		}
>  
>  		priv->rproc->state = RPROC_DETACHED;
> -		priv->rproc->recovery_disabled = true;
> +		priv->rproc->recovery_disabled = false;
> +		rproc_set_feature(priv->rproc, RPROC_FEAT_ATTACH_ON_RECOVERY);
>  
>  		/* Get partition id and enable irq in SCFW */
>  		ret = imx_sc_rm_get_resource_owner(priv->ipc_handle, priv->rsrc_id, &pt);
> -- 
> 2.37.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ