summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2018-07-26 20:15:35 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-07-30 21:11:43 -0700
commitf68d51bd8a7141ba84f06e6207197817398e7f3a (patch)
tree4e16c31f95fcef27ec385050884856a4e4e3435d /drivers/remoteproc
parent7cbb540a3a68e4d4a8bef2d9451afb1635b5d2d3 (diff)
downloadblackbird-op-linux-f68d51bd8a7141ba84f06e6207197817398e7f3a.tar.gz
blackbird-op-linux-f68d51bd8a7141ba84f06e6207197817398e7f3a.zip
remoteproc: Reset table_ptr in rproc_start() failure paths
Unwind the modified table_ptr and restore it to the local copy upon any subsequent failures in the rproc_start() function. This keeps the function to remain balanced on failures without the need to balance any modified variables elsewhere. While at this, do some minor cleanup of the extra lines between the failure labels as well. Signed-off-by: Suman Anna <s-anna@ti.com> [bjorn: unconditionally set table_ptr to cached_table] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 283b258f5e0f..38a5e98d7dd7 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -940,7 +940,7 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw)
if (ret) {
dev_err(dev, "failed to prepare subdevices for %s: %d\n",
rproc->name, ret);
- return ret;
+ goto reset_table_ptr;
}
/* power up the remote processor */
@@ -966,9 +966,10 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw)
stop_rproc:
rproc->ops->stop(rproc);
-
unprepare_subdevices:
rproc_unprepare_subdevices(rproc);
+reset_table_ptr:
+ rproc->table_ptr = rproc->cached_table;
return ret;
}
OpenPOWER on IntegriCloud