Linux-remoteproc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery
@ 2020-04-29 18:04 Rishabh Bhatnagar
  2020-05-12 19:12 ` Bjorn Andersson
  2020-05-13  6:20 ` patchwork-bot+linux-remoteproc
  0 siblings, 2 replies; 3+ messages in thread
From: Rishabh Bhatnagar @ 2020-04-29 18:04 UTC (permalink / raw)
  To: linux-remoteproc, bjorn.andersson
  Cc: ohad, linux-kernel, tsoni, psodagud, sidgup, Rishabh Bhatnagar

The system might go into suspend during recovery of any remoteproc.
This will interrupt the recovery process in between increasing the
recovery time. Make the platform device as wakeup capable and
use pm_stay_wake/pm_relax APIs to avoid system from going into
suspend during recovery.

Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/remoteproc/qcom_q6v5_pas.c   | 2 ++
 drivers/remoteproc/remoteproc_core.c | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index edf9d0e..e608578 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -398,6 +398,8 @@ static int adsp_probe(struct platform_device *pdev)
 	adsp->has_aggre2_clk = desc->has_aggre2_clk;
 	platform_set_drvdata(pdev, adsp);
 
+	device_wakeup_enable(adsp->dev);
+
 	ret = adsp_alloc_memory_region(adsp);
 	if (ret)
 		goto free_rproc;
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 097f33e..6a1cb98 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.parent);
 }
 
 /**
@@ -2208,6 +2210,9 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type)
 		return;
 	}
 
+	/* Prevent suspend while the remoteproc is being recovered */
+	pm_stay_awake(rproc->dev.parent);
+
 	dev_err(&rproc->dev, "crash detected in %s: type %s\n",
 		rproc->name, rproc_crash_to_string(type));
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery
  2020-04-29 18:04 [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery Rishabh Bhatnagar
@ 2020-05-12 19:12 ` Bjorn Andersson
  2020-05-13  6:20 ` patchwork-bot+linux-remoteproc
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2020-05-12 19:12 UTC (permalink / raw)
  To: Rishabh Bhatnagar
  Cc: linux-remoteproc, ohad, linux-kernel, tsoni, psodagud, sidgup

On Wed 29 Apr 11:04 PDT 2020, Rishabh Bhatnagar wrote:

> The system might go into suspend during recovery of any remoteproc.
> This will interrupt the recovery process in between increasing the
> recovery time. Make the platform device as wakeup capable and
> use pm_stay_wake/pm_relax APIs to avoid system from going into
> suspend during recovery.
> 
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---

Please don't forget to add a version to $subject and provide a Changelog
here next time you're respinning something.

I've picked this up now.

Thanks,
Bjorn

>  drivers/remoteproc/qcom_q6v5_pas.c   | 2 ++
>  drivers/remoteproc/remoteproc_core.c | 5 +++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index edf9d0e..e608578 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -398,6 +398,8 @@ static int adsp_probe(struct platform_device *pdev)
>  	adsp->has_aggre2_clk = desc->has_aggre2_clk;
>  	platform_set_drvdata(pdev, adsp);
>  
> +	device_wakeup_enable(adsp->dev);
> +
>  	ret = adsp_alloc_memory_region(adsp);
>  	if (ret)
>  		goto free_rproc;
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 097f33e..6a1cb98 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.parent);
>  }
>  
>  /**
> @@ -2208,6 +2210,9 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type)
>  		return;
>  	}
>  
> +	/* Prevent suspend while the remoteproc is being recovered */
> +	pm_stay_awake(rproc->dev.parent);
> +
>  	dev_err(&rproc->dev, "crash detected in %s: type %s\n",
>  		rproc->name, rproc_crash_to_string(type));
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery
  2020-04-29 18:04 [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery Rishabh Bhatnagar
  2020-05-12 19:12 ` Bjorn Andersson
@ 2020-05-13  6:20 ` patchwork-bot+linux-remoteproc
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-05-13  6:20 UTC (permalink / raw)
  To: Rishabh Bhatnagar; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next).

On Wed, 29 Apr 2020 11:04:42 -0700 you wrote:
> The system might go into suspend during recovery of any remoteproc.
> This will interrupt the recovery process in between increasing the
> recovery time. Make the platform device as wakeup capable and
> use pm_stay_wake/pm_relax APIs to avoid system from going into
> suspend during recovery.
> 
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> [...]


Here is a summary with links:
  - remoteproc: core: Prevent system suspend during remoteproc recovery
    https://git.kernel.org/andersson/remoteproc/c/a781e5aa59110d002a56bd41a397c0c8892f0609

You are awesome, thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 18:04 [PATCH] remoteproc: core: Prevent system suspend during remoteproc recovery Rishabh Bhatnagar
2020-05-12 19:12 ` Bjorn Andersson
2020-05-13  6:20 ` patchwork-bot+linux-remoteproc

Linux-remoteproc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-remoteproc/0 linux-remoteproc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-remoteproc linux-remoteproc/ https://lore.kernel.org/linux-remoteproc \
		linux-remoteproc@vger.kernel.org
	public-inbox-index linux-remoteproc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-remoteproc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git