@@ -1720,6 +1720,14 @@ static void rproc_crash_handler_work(struct work_struct *work)
dev_err(dev, "handling crash #%u in %s\n", ++rproc->crash_cnt,
rproc->name);
+ /*
+ * The MCU has crashed - tell the core what operation to
+ * use from hereon, i.e whether an external entity will
+ * reboot the MCU or it is now the remoteproc core's
+ * responsability.
+ */
+ rproc_set_mcu_sync_state(rproc, RPROC_SYNC_STATE_CRASHED);
+
mutex_unlock(&rproc->lock);
if (!rproc->recovery_disabled)
@@ -1854,6 +1862,13 @@ void rproc_shutdown(struct rproc *rproc)
kfree(rproc->cached_table);
rproc->cached_table = NULL;
rproc->table_ptr = NULL;
+
+ /*
+ * The MCU has been switched off - tell the core what operation to
+ * use from hereon, i.e whether an external entity will reboot the
+ * MCU or it is now the remoteproc core's responsability.
+ */
+ rproc_set_mcu_sync_state(rproc, RPROC_SYNC_STATE_SHUTDOWN);
out:
mutex_unlock(&rproc->lock);
}
Call on the MCU synchronisation state machine to determine the synchronisation status to enact when the MCU is either stop from sysfs or has crashed. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> --- drivers/remoteproc/remoteproc_core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)