From: rishabhb@codeaurora.org To: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Siddharth Gupta <sidgup@codeaurora.org>, ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, linux-remoteproc-owner@vger.kernel.org Subject: Re: [PATCH 2/2] remoteproc: core: Prevent sleep when rproc crashes Date: Tue, 07 Apr 2020 15:59:59 -0700 [thread overview] Message-ID: <c98b9b02c49b41c6e2493407f11c5eac@codeaurora.org> (raw) In-Reply-To: <20200407222958.GL20625@builder.lan> On 2020-04-07 15:29, Bjorn Andersson wrote: > On Wed 19 Feb 18:11 PST 2020, Siddharth Gupta wrote: > >> Remoteproc recovery should be fast and any delay will have an impact >> on the >> user-experience. Use power management APIs (pm_stay_awake and >> pm_relax) to >> ensure that the system does not go to sleep. >> >> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> >> --- >> drivers/remoteproc/remoteproc_core.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/remoteproc/remoteproc_core.c >> b/drivers/remoteproc/remoteproc_core.c >> index 5ab65a4..52e318c 100644 >> --- a/drivers/remoteproc/remoteproc_core.c >> +++ b/drivers/remoteproc/remoteproc_core.c >> @@ -1712,6 +1712,8 @@ static void rproc_crash_handler_work(struct >> work_struct *work) >> >> if (!rproc->recovery_disabled) >> rproc_trigger_recovery(rproc); >> + >> + pm_relax(&rproc->dev); >> } >> >> /** >> @@ -2242,6 +2244,8 @@ void rproc_report_crash(struct rproc *rproc, >> enum rproc_crash_type type) >> return; >> } >> >> + pm_stay_awake(&rproc->dev); > > Following Mathieu's question I was expecting you to do this on > rproc->dev.parent. > > But looking at the implementation of pm_stay_awake(), it ends up being > a > nop if dev->power.wakeup isn't specified. This in turn seems to come > from device_wakeup_enable(), which will bail if dev->power.can_wakeup > is > not set. But I don't see where this would be set for either the > platform > driver or the remoteproc's struct device - and neither one of them have > a "wakeup" attribute in sysfs. > > Is there some additional plumbing needed for this? We should be able to create a standalone wakeup source using wakeup_source_init. Then we can use _pm_stay_awake and _pm_relax on it. > > Regards, > Bjorn > >> + >> dev_err(&rproc->dev, "crash detected in %s: type %s\n", >> rproc->name, rproc_crash_to_string(type)); >> >> -- >> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >> a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: rishabhb@codeaurora.org To: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: ohad@wizery.com, tsoni@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc-owner@vger.kernel.org, Siddharth Gupta <sidgup@codeaurora.org>, psodagud@codeaurora.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] remoteproc: core: Prevent sleep when rproc crashes Date: Tue, 07 Apr 2020 15:59:59 -0700 [thread overview] Message-ID: <c98b9b02c49b41c6e2493407f11c5eac@codeaurora.org> (raw) In-Reply-To: <20200407222958.GL20625@builder.lan> On 2020-04-07 15:29, Bjorn Andersson wrote: > On Wed 19 Feb 18:11 PST 2020, Siddharth Gupta wrote: > >> Remoteproc recovery should be fast and any delay will have an impact >> on the >> user-experience. Use power management APIs (pm_stay_awake and >> pm_relax) to >> ensure that the system does not go to sleep. >> >> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> >> --- >> drivers/remoteproc/remoteproc_core.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/remoteproc/remoteproc_core.c >> b/drivers/remoteproc/remoteproc_core.c >> index 5ab65a4..52e318c 100644 >> --- a/drivers/remoteproc/remoteproc_core.c >> +++ b/drivers/remoteproc/remoteproc_core.c >> @@ -1712,6 +1712,8 @@ static void rproc_crash_handler_work(struct >> work_struct *work) >> >> if (!rproc->recovery_disabled) >> rproc_trigger_recovery(rproc); >> + >> + pm_relax(&rproc->dev); >> } >> >> /** >> @@ -2242,6 +2244,8 @@ void rproc_report_crash(struct rproc *rproc, >> enum rproc_crash_type type) >> return; >> } >> >> + pm_stay_awake(&rproc->dev); > > Following Mathieu's question I was expecting you to do this on > rproc->dev.parent. > > But looking at the implementation of pm_stay_awake(), it ends up being > a > nop if dev->power.wakeup isn't specified. This in turn seems to come > from device_wakeup_enable(), which will bail if dev->power.can_wakeup > is > not set. But I don't see where this would be set for either the > platform > driver or the remoteproc's struct device - and neither one of them have > a "wakeup" attribute in sysfs. > > Is there some additional plumbing needed for this? We should be able to create a standalone wakeup source using wakeup_source_init. Then we can use _pm_stay_awake and _pm_relax on it. > > Regards, > Bjorn > >> + >> dev_err(&rproc->dev, "crash detected in %s: type %s\n", >> rproc->name, rproc_crash_to_string(type)); >> >> -- >> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >> a Linux Foundation Collaborative Project _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-04-07 22:59 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-20 2:11 [PATCH 0/2] remoteproc: core: Add core functionality to the remoteproc framework Siddharth Gupta 2020-02-20 2:11 ` Siddharth Gupta 2020-02-20 2:11 ` [PATCH 1/2] remoteproc: core: Add an API for booting with firmware name Siddharth Gupta 2020-02-20 2:11 ` Siddharth Gupta 2020-02-24 18:30 ` Mathieu Poirier 2020-02-24 18:30 ` Mathieu Poirier 2020-02-26 23:10 ` Siddharth Gupta 2020-02-26 23:10 ` Siddharth Gupta 2020-02-20 2:11 ` [PATCH 2/2] remoteproc: core: Prevent sleep when rproc crashes Siddharth Gupta 2020-02-20 2:11 ` Siddharth Gupta 2020-02-24 18:53 ` Mathieu Poirier 2020-02-24 18:53 ` Mathieu Poirier 2020-04-07 18:00 ` Siddharth Gupta 2020-04-07 18:00 ` Siddharth Gupta 2020-04-07 22:29 ` Bjorn Andersson 2020-04-07 22:29 ` Bjorn Andersson 2020-04-07 22:30 ` Bjorn Andersson 2020-04-07 22:29 ` Bjorn Andersson 2020-04-07 22:59 ` rishabhb [this message] 2020-04-07 22:59 ` rishabhb 2020-04-07 23:26 ` Bjorn Andersson 2020-04-07 23:26 ` Bjorn Andersson 2020-04-07 23:27 ` Bjorn Andersson 2020-04-07 23:26 ` Bjorn Andersson
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=c98b9b02c49b41c6e2493407f11c5eac@codeaurora.org \ --to=rishabhb@codeaurora.org \ --cc=bjorn.andersson@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-remoteproc-owner@vger.kernel.org \ --cc=linux-remoteproc@vger.kernel.org \ --cc=ohad@wizery.com \ --cc=psodagud@codeaurora.org \ --cc=sidgup@codeaurora.org \ --cc=tsoni@codeaurora.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.