Skip to content

Commit

Permalink
remoteproc: core: Prevent system suspend during remoteproc recovery
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/1588183482-21146-1-git-send-email-rishabhb@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Rishabh Bhatnagar authored and andersson committed May 12, 2020
1 parent 9666174 commit a781e5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/remoteproc/qcom_q6v5_pas.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,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;
Expand Down
5 changes: 5 additions & 0 deletions drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,8 @@ static void rproc_crash_handler_work(struct work_struct *work)

if (!rproc->recovery_disabled)
rproc_trigger_recovery(rproc);

pm_relax(rproc->dev.parent);
}

/**
Expand Down Expand Up @@ -2353,6 +2355,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));

Expand Down

0 comments on commit a781e5a

Please sign in to comment.