Skip to content

Commit 11c7f9e

Browse files
Maria Yumathieupoirier
authored andcommitted
remoteproc: core: Do pm_relax when in RPROC_OFFLINE state
Make sure that pm_relax() happens even when the remoteproc is stopped before the crash handler work is scheduled. Signed-off-by: Maria Yu <[email protected]> Cc: stable <[email protected]> Fixes: a781e5a ("remoteproc: core: Prevent system suspend during remoteproc recovery") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 7ff5d60 commit 11c7f9e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,12 +1868,18 @@ static void rproc_crash_handler_work(struct work_struct *work)
18681868

18691869
mutex_lock(&rproc->lock);
18701870

1871-
if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) {
1871+
if (rproc->state == RPROC_CRASHED) {
18721872
/* handle only the first crash detected */
18731873
mutex_unlock(&rproc->lock);
18741874
return;
18751875
}
18761876

1877+
if (rproc->state == RPROC_OFFLINE) {
1878+
/* Don't recover if the remote processor was stopped */
1879+
mutex_unlock(&rproc->lock);
1880+
goto out;
1881+
}
1882+
18771883
rproc->state = RPROC_CRASHED;
18781884
dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
18791885
rproc->name);
@@ -1883,6 +1889,7 @@ static void rproc_crash_handler_work(struct work_struct *work)
18831889
if (!rproc->recovery_disabled)
18841890
rproc_trigger_recovery(rproc);
18851891

1892+
out:
18861893
pm_relax(rproc->dev.parent);
18871894
}
18881895

0 commit comments

Comments
 (0)