Skip to content

Commit a781e5a

Browse files
Rishabh Bhatnagarandersson
authored andcommitted
remoteproc: core: Prevent system suspend during remoteproc recovery
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 <[email protected]> Signed-off-by: Rishabh Bhatnagar <[email protected]> Acked-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 9666174 commit a781e5a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/remoteproc/qcom_q6v5_pas.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ static int adsp_probe(struct platform_device *pdev)
407407
adsp->has_aggre2_clk = desc->has_aggre2_clk;
408408
platform_set_drvdata(pdev, adsp);
409409

410+
device_wakeup_enable(adsp->dev);
411+
410412
ret = adsp_alloc_memory_region(adsp);
411413
if (ret)
412414
goto free_rproc;

drivers/remoteproc/remoteproc_core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,8 @@ static void rproc_crash_handler_work(struct work_struct *work)
17661766

17671767
if (!rproc->recovery_disabled)
17681768
rproc_trigger_recovery(rproc);
1769+
1770+
pm_relax(rproc->dev.parent);
17691771
}
17701772

17711773
/**
@@ -2353,6 +2355,9 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type)
23532355
return;
23542356
}
23552357

2358+
/* Prevent suspend while the remoteproc is being recovered */
2359+
pm_stay_awake(rproc->dev.parent);
2360+
23562361
dev_err(&rproc->dev, "crash detected in %s: type %s\n",
23572362
rproc->name, rproc_crash_to_string(type));
23582363

0 commit comments

Comments
 (0)