aboutsummaryrefslogtreecommitdiffci
path: root/patches/remoteproc/0010-remoteproc-qcom_q6v5-Send-SMP2P-stop-signal-in-attac.patch
blob: 4f04538f4c9c5d6915697401581c24e73bf1cf34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
If we stop the q6v5 remoteproc while it is in RPROC_ATTACHED or
RPROC_DETACHED state, we still want to send the stop signal to shut it down
cleanly.

The main goal of the check in qcom_q6v5_request_stop() is to avoid sending
duplicate shutdown/stop signals during crash or shutdown via sysmon, so
check for RPROC_CRASHED to handle all of RPROC_RUNNING, RPROC_ATTACHED and
RPROC_DETACHED. It does not make sense to call the function while in
RPROC_OFFLINE state.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
---
 drivers/remoteproc/qcom_q6v5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index 94c75d9cc..ed1b578a8 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -231,8 +231,8 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon)
 
 	q6v5->running = false;
 
-	/* A watchdog/fatal IRQ clears running; logical crashes still need a stop. */
-	if (!was_running || qcom_sysmon_shutdown_acked(sysmon))
+	/* A watchdog/fatal IRQ clears running; logical crashes still need a stop. */
+	if (q6v5->rproc->state == RPROC_CRASHED || qcom_sysmon_shutdown_acked(sysmon))
 		return 0;
 
 	qcom_smem_state_update_bits(q6v5->state,