[PATCH 2/2] remoteproc: core: Prevent sleep when rproc crashes

From: Siddharth Gupta
Date: Wed Feb 19 2020 - 21:12:29 EST


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@xxxxxxxxxxxxxx>
---
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);
+
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