Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: "Aiqun(Maria) Yu" <quic_aiquny@quicinc.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <arnaud.pouliquen@foss.st.com>, <linux-arm-msm@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>, <quic_clew@quicinc.com>
Subject: Re: [PATCH v5 1/2] remoteproc: core: do pm relax when in RPROC_OFFLINE
Date: Tue, 6 Dec 2022 08:58:01 +0800	[thread overview]
Message-ID: <fa62ad12-7b37-67b0-fbfa-4050b994371a@quicinc.com> (raw)
In-Reply-To: <20221202173015.GC165812@p14s>

On 12/3/2022 1:30 AM, Mathieu Poirier wrote:
> On Fri, Dec 02, 2022 at 05:45:31PM +0800, Maria Yu wrote:
>> RPROC_OFFLINE state indicate there is no recovery process
>> is in progress and no chance to do the pm_relax.
>> Because when recovering from crash, rproc->lock is held and
>> state is RPROC_CRASHED -> RPROC_OFFLINE -> RPROC_RUNNING,
>> and then unlock rproc->lock.
>> When the state is in RPROC_OFFLINE it means separate request
>> of rproc_stop was done and no need to hold the wakeup source
>> in crash handler to recover any more.
>>
>> Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
>> ---
>>   drivers/remoteproc/remoteproc_core.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>> index 8768cb64f560..c2d0af048c69 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -1862,11 +1862,16 @@ 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;
>>   	}
> 
> Please add a newline here.
> 
Will be addressed in new patchset. Thx.
>> +	if (rproc->state == RPROC_OFFLINE) {
>> +		/* no need to recover if remote processor is offline */
>> +		mutex_unlock(&rproc->lock);
>> +		goto out;
>> +	}
>>   
>>   	rproc->state = RPROC_CRASHED;
>>   	dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
>> @@ -1877,6 +1882,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);
>>   }
>>   
>> -- 
>> 2.17.1
>>


-- 
Thx and BRs,
Aiqun(Maria) Yu

  reply	other threads:[~2022-12-06  0:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  9:45 [PATCH v5 0/2] remoteproc: core: do pm relax when in Maria Yu
2022-12-02  9:45 ` [PATCH v5 1/2] remoteproc: core: do pm relax when in RPROC_OFFLINE Maria Yu
2022-12-02 17:30   ` Mathieu Poirier
2022-12-06  0:58     ` Aiqun(Maria) Yu [this message]
2022-12-02 18:09   ` Bjorn Andersson
2022-12-06  1:05     ` Aiqun(Maria) Yu
2022-12-02  9:45 ` [PATCH v5 2/2] remoteproc: core: change to ordered workqueue for crash handler Maria Yu
2022-12-02 17:34   ` Mathieu Poirier
2022-12-06  1:28     ` Aiqun(Maria) Yu
2022-12-07 18:16       ` Mathieu Poirier
2022-12-02 18:16   ` Bjorn Andersson
2022-12-06  1:42     ` Aiqun(Maria) Yu

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=fa62ad12-7b37-67b0-fbfa-4050b994371a@quicinc.com \
    --to=quic_aiquny@quicinc.com \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=quic_clew@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