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] [day] [month] [year] [list]
Date:   Wed, 7 Dec 2022 11:36:39 -0700
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Maria Yu <quic_aiquny@...cinc.com>
Cc:     andersson@...nel.org, linux-remoteproc@...r.kernel.org,
        linux-kernel@...r.kernel.org, quic_clew@...cinc.com,
        quic_mojha@...cinc.com
Subject: Re: [PATCH v6 1/1] remoteproc: core: do pm_relax when in
 RPROC_OFFLINE state

On Tue, Dec 06, 2022 at 09:59:57AM +0800, Maria Yu wrote:
> Make sure that pm_relax() happens even when the remoteproc
> is stopped before the crash handler work is scheduled.
> 
> Signed-off-by: Maria Yu <quic_aiquny@...cinc.com>
> ---
>  drivers/remoteproc/remoteproc_core.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 8768cb64f560..7419e1460f2a 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1862,12 +1862,18 @@ static void rproc_crash_handler_work(struct work_struct *work)
>  
>  	mutex_lock(&rproc->lock);
>  
> -	if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) {
> +	if (rproc->state == RPROC_CRASHED) {
>  		/* handle only the first crash detected */
>  		mutex_unlock(&rproc->lock);
>  		return;
>  	}
>  
> +	if (rproc->state == RPROC_OFFLINE) {
> +		/* Don't recover if the remote processor was stopped */
> +		mutex_unlock(&rproc->lock);
> +		goto out;
> +	}
> +
>  	rproc->state = RPROC_CRASHED;
>  	dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
>  		rproc->name);
> @@ -1877,6 +1883,7 @@ static void rproc_crash_handler_work(struct work_struct *work)
>  	if (!rproc->recovery_disabled)
>  		rproc_trigger_recovery(rproc);
>  
> +out:
>  	pm_relax(rproc->dev.parent);

I have applied this patch.

Thanks,
Mathieu

>  }
>  
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ