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: <linux-remoteproc@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_clew@quicinc.com>
Subject: Re: [PATCH v1] remoteproc: core: do pm relax when not first crash
Date: Tue, 13 Sep 2022 19:03:32 +0800	[thread overview]
Message-ID: <128dc161-8949-1146-bf8b-310aa33c06a8@quicinc.com> (raw)
In-Reply-To: <20220909192357.GA319190@p14s>

Hi Mathieu,

pm_awake and pm_relax needed to be used as a pair. There is chance that 
pm_relax is not being called, and make the device always in cannot 
suspend state.

On 9/10/2022 3:23 AM, Mathieu Poirier wrote:
> Hi Maria,
> 
> On Fri, Sep 09, 2022 at 04:33:33PM +0800, Maria Yu wrote:
>> Even if it is not first crash, need to relax the pm
>> wakelock otherwise the device will stay awake.
>>
> 
> The goal is exactly to keep the device awake...
> 
>> Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
>> ---
>>   drivers/remoteproc/remoteproc_core.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>> index e5279ed9a8d7..30078043e939 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -1956,6 +1956,7 @@ static void rproc_crash_handler_work(struct work_struct *work)
>>   	if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) {
>>   		/* handle only the first crash detected */
>>   		mutex_unlock(&rproc->lock);
>> +		pm_relax(rproc->dev.parent);
> 
> If we are here it means that rproc_crash_handler_work() has already been called
> _and_ that a recovery is in process.  When the first crash handler completes
> pm_relax() will be called and the device will go to sleep as expected.
If the rproc->state cannot be changed to running state, the device will 
always be awake from this return.
Also APROC_OFFLINE state can be given in other path like an shutdown 
request is issued.

While this patch is not considering carefully as well, I think I need to 
upload a new patchset with an ordered workqueue to make each work have 
each pm_relax before return.
what do you think?
> 
> Thanks,
> Mathieu
> 
>>   		return;
>>   	}
>>   
>> -- 
>> 2.7.4
>>


-- 
Thx and BRs,
Aiqun(Maria) Yu

  reply	other threads:[~2022-09-13 11:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  8:33 [PATCH v1] remoteproc: core: do pm relax when not first crash Maria Yu
2022-09-09 19:23 ` Mathieu Poirier
2022-09-13 11:03   ` Aiqun(Maria) Yu [this message]
2022-09-15 10:04     ` [PATCH v2] remoteproc: core: do pm relax when in RPROC_OFFLINE Maria Yu
2022-09-15 12:47       ` Mukesh Ojha
2022-09-16  1:34         ` Aiqun(Maria) Yu
2022-09-16  1:36     ` [PATCH v3] " Maria Yu
2022-09-16  7:12     ` [PATCH v4] " Maria Yu
2022-09-16  8:47       ` Mukesh Ojha
2022-10-12 20:43       ` Mathieu Poirier
2022-10-13  1:40         ` Aiqun(Maria) Yu
2022-10-13 17:34           ` Mathieu Poirier
2022-10-13 18:03             ` Mathieu Poirier
2022-10-20  5:52               ` Aiqun(Maria) Yu
2022-10-21 19:34                 ` Mathieu Poirier
2022-10-24  3:17                   ` Aiqun(Maria) Yu
2022-10-28 15:31                     ` Arnaud POULIQUEN
2022-10-31  1:08                       ` Aiqun(Maria) Yu
2022-11-01 20:11                       ` Mathieu Poirier
2022-11-02 10:53                         ` Aiqun(Maria) Yu
2022-11-02 18:03                           ` Mathieu Poirier
2022-11-03  2:03                             ` Aiqun(Maria) Yu
2022-11-04 15:59                               ` Mathieu Poirier
2022-11-07  1:14                                 ` Aiqun(Maria) Yu
2022-11-10 20:50                                   ` Mathieu Poirier
2022-11-11  0:52                                     ` Aiqun(Maria) Yu
2022-11-14 21:18                                       ` Mathieu Poirier
2022-11-15  1:30                                         ` Aiqun(Maria) Yu
2022-11-18 18:52                                           ` Mathieu Poirier
2022-11-21  1:43                                             ` Aiqun(Maria) Yu
2022-11-25 18:37                                             ` Mathieu Poirier
2022-11-28  2:18                                               ` Aiqun(Maria) Yu
2022-12-01 23:00                                                 ` Mathieu Poirier
2022-12-02  1:17                                                   ` Aiqun(Maria) Yu
2022-09-16 17:05     ` [PATCH v1] remoteproc: core: do pm relax when not first crash Mathieu Poirier
2022-09-19  0:54       ` 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=128dc161-8949-1146-bf8b-310aa33c06a8@quicinc.com \
    --to=quic_aiquny@quicinc.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@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