Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Maria Yu <quic_aiquny@quicinc.com>
Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org, quic_clew@quicinc.com,
	quic_mojha@quicinc.com
Subject: Re: [PATCH v6 1/1] remoteproc: core: do pm_relax when in RPROC_OFFLINE state
Date: Wed, 7 Dec 2022 11:36:39 -0700	[thread overview]
Message-ID: <20221207183639.GB527346@p14s> (raw)
In-Reply-To: <20221206015957.2616-2-quic_aiquny@quicinc.com>

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@quicinc.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
> 

      reply	other threads:[~2022-12-07 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  1:59 [PATCH v6 0/1] remoteproc: core: do pm relax when in Maria Yu
2022-12-06  1:59 ` [PATCH v6 1/1] remoteproc: core: do pm_relax when in RPROC_OFFLINE state Maria Yu
2022-12-07 18:36   ` Mathieu Poirier [this message]

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=20221207183639.GB527346@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=andersson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=quic_aiquny@quicinc.com \
    --cc=quic_clew@quicinc.com \
    --cc=quic_mojha@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox