summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFernando Guzman Lugo <fernando.lugo@ti.com>2012-07-10 12:35:44 -0500
committerAndy Green <andy.green@linaro.org>2012-09-07 13:05:54 +0800
commitc2fb2e046f70016cacab3e850cacd4bb1cca37f4 (patch)
treed1331bcef033d329244eff543f533159070a28e9 /drivers
parent4560dd7b8f6028c98f33920ed5f14fa96d972dcf (diff)
remoteproc: handle only the first fatal error
The remoteproc driver gets notified of a Watchdog error or a MMU Fault directly through an interrupt, and other internal exceptions through a mailbox message. The remote processors can also get an interrupt for printing the back trace for all exceptions, and may end up in sending a exception mailbox message for the same error to the kernel-side. However, the error handler thread has to handle only the first error and bail out if the processing of the first error message is still ongoing. A check has therefore been added to verify that the rproc state is not already RPROC_CRASHED or RPROC_OFFLINE. Change-Id: If44432fe245dd733a7e7ce29128eed00eb921f49 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/remoteproc/remoteproc_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 2fc457bebe90..e05856796738 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -267,8 +267,6 @@ void rproc_error_reporter(struct rproc *rproc, enum rproc_err type)
dev_err(dev, "fatal error #%u detected in %s: error type %s\n",
++rproc->crash_cnt, rproc->name, rproc_err_to_string(type));
- rproc->state = RPROC_CRASHED;
-
/*
* as this function can be called from a ISR or a atomic context
* we need to create a workqueue to handle the error
@@ -1874,6 +1872,14 @@ static void rproc_error_handler_work(struct work_struct *work)
dev_dbg(dev, "enter %s\n", __func__);
+ mutex_lock(&rproc->lock);
+ if (rproc->state == RPROC_CRASHED || rproc->state == RPROC_OFFLINE) {
+ mutex_unlock(&rproc->lock);
+ return;
+ }
+
+ rproc->state = RPROC_CRASHED;
+ mutex_unlock(&rproc->lock);
/*
* if recovery enabled reset all virtio devices, so that all rpmsg
* drivers can be restarted in order to make them functional again