aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorFernando Guzman Lugo <fernando.lugo@ti.com>2011-10-18 23:29:15 -0500
committerFernando Guzman Lugo <fernando.lugo@ti.com>2011-10-19 02:52:31 -0500
commite43cfabdaa8dd4a186a7084e910bd1d39b60ff8f (patch)
tree3d4d2f6e4a61442650b3e276795e8cd3619afbbe /drivers/remoteproc
parent55dd10030466bb294836d3b670bb778fcf202d68 (diff)
downloadkernel_samsung_tuna-e43cfabdaa8dd4a186a7084e910bd1d39b60ff8f.tar.gz
kernel_samsung_tuna-e43cfabdaa8dd4a186a7084e910bd1d39b60ff8f.tar.bz2
kernel_samsung_tuna-e43cfabdaa8dd4a186a7084e910bd1d39b60ff8f.zip
remoteproc: end gracefully in case of a error in rproc_start
Add error path in rproc_start function in order to clean things up in case of a error inside rproc_start. Change-Id: Ie8094e68d91ce91ac8cfd88e44057a80e7372459 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c
index ef9d0ffad23..680a701f11d 100644
--- a/drivers/remoteproc/remoteproc.c
+++ b/drivers/remoteproc/remoteproc.c
@@ -655,7 +655,7 @@ static void rproc_start(struct rproc *rproc, u64 bootaddr)
if (err) {
dev_err(dev, "can't configure watchdog timer %d\n",
err);
- goto unlock_mutex;
+ goto wdt_error;
}
}
@@ -667,7 +667,7 @@ static void rproc_start(struct rproc *rproc, u64 bootaddr)
err = rproc->ops->start(rproc, bootaddr);
if (err) {
dev_err(dev, "can't start rproc %s: %d\n", rproc->name, err);
- goto unlock_mutex;
+ goto start_error;
}
#ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND
@@ -683,14 +683,25 @@ static void rproc_start(struct rproc *rproc, u64 bootaddr)
rproc->state = RPROC_RUNNING;
dev_info(dev, "remote processor %s is now up\n", rproc->name);
+ rproc->secure_ok = true;
+ complete_all(&rproc->secure_restart);
+ mutex_unlock(&rproc->lock);
+
+ return;
-unlock_mutex:
/*
* signal always, as we would need a notification in both the
* normal->secure & secure->normal mode transitions, otherwise
* we would have to introduce one more variable.
*/
- rproc->secure_ok = !err;
+start_error:
+ if (rproc->ops->watchdog_exit)
+ rproc->ops->watchdog_exit(rproc);
+wdt_error:
+ if (rproc->ops->iommu_exit)
+ rproc->ops->iommu_exit(rproc);
+unlock_mutex:
+ rproc->secure_ok = false;
complete_all(&rproc->secure_restart);
mutex_unlock(&rproc->lock);
}