Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494628 > unrolled thread

[PATCH] remoteproc: Correct resource handling upon boot failure

Started byBjorn Andersson <bjorn.andersson@linaro.org>
First post2016-10-03 02:50 +0200
Last post2016-10-03 02:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] remoteproc: Correct resource handling upon boot failure Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-10-03 02:50 +0200

#1494628 — [PATCH] remoteproc: Correct resource handling upon boot failure

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2016-10-03 02:50 +0200
Subject[PATCH] remoteproc: Correct resource handling upon boot failure
Message-ID<snZCa-5us-7@gated-at.bofh.it>
The freeing of resources will attempt to clear values previously set in
the cached resource table, so make sure to free the table after we have
cleaned up the resources.

Fixes: 988d204cdaf6 ("remoteproc: Move handling of cached table to boot/shutdown")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/remoteproc/remoteproc_core.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 92a1037c1b2e..3da566b0d437 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -847,14 +847,14 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
 	ret = rproc_handle_resources(rproc, tablesz, rproc_loading_handlers);
 	if (ret) {
 		dev_err(dev, "Failed to process resources: %d\n", ret);
-		goto clean_up;
+		goto clean_up_resources;
 	}
 
 	/* load the ELF segments to memory */
 	ret = rproc_load_segments(rproc, fw);
 	if (ret) {
 		dev_err(dev, "Failed to load program segments: %d\n", ret);
-		goto clean_up;
+		goto clean_up_resources;
 	}
 
 	/*
@@ -875,7 +875,7 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
 	ret = rproc->ops->start(rproc);
 	if (ret) {
 		dev_err(dev, "can't start rproc %s: %d\n", rproc->name, ret);
-		goto clean_up;
+		goto clean_up_resources;
 	}
 
 	rproc->state = RPROC_RUNNING;
@@ -884,12 +884,13 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
 
 	return 0;
 
+clean_up_resources:
+	rproc_resource_cleanup(rproc);
 clean_up:
 	kfree(rproc->cached_table);
 	rproc->cached_table = NULL;
 	rproc->table_ptr = NULL;
 
-	rproc_resource_cleanup(rproc);
 	rproc_disable_iommu(rproc);
 	return ret;
 }
-- 
2.5.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web