remoteproc: core: Do pm_relax when in RPROC_OFFLINE state
commit 11c7f9e3131ad14b27a957496088fa488b153a48 upstream.
Make sure that pm_relax() happens even when the remoteproc
is stopped before the crash handler work is scheduled.
Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
Cc: stable <stable@vger.kernel.org>
Fixes: a781e5aa59
("remoteproc: core: Prevent system suspend during remoteproc recovery")
Link: https://lore.kernel.org/r/20221206015957.2616-2-quic_aiquny@quicinc.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
e291dea722
commit
2c7c487cd8
@@ -1741,12 +1741,18 @@ static void rproc_crash_handler_work(struct work_struct *work)
|
|||||||
|
|
||||||
mutex_lock(&rproc->lock);
|
mutex_lock(&rproc->lock);
|
||||||
|
|
||||||
if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) {
|
if (rproc->state == RPROC_CRASHED) {
|
||||||
/* handle only the first crash detected */
|
/* handle only the first crash detected */
|
||||||
mutex_unlock(&rproc->lock);
|
mutex_unlock(&rproc->lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rproc->state == RPROC_OFFLINE) {
|
||||||
|
/* Don't recover if the remote processor was stopped */
|
||||||
|
mutex_unlock(&rproc->lock);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
rproc->state = RPROC_CRASHED;
|
rproc->state = RPROC_CRASHED;
|
||||||
dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
|
dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
|
||||||
rproc->name);
|
rproc->name);
|
||||||
@@ -1756,6 +1762,7 @@ static void rproc_crash_handler_work(struct work_struct *work)
|
|||||||
if (!rproc->recovery_disabled)
|
if (!rproc->recovery_disabled)
|
||||||
rproc_trigger_recovery(rproc);
|
rproc_trigger_recovery(rproc);
|
||||||
|
|
||||||
|
out:
|
||||||
pm_relax(rproc->dev.parent);
|
pm_relax(rproc->dev.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user