Skip to contentSkip to conversation

remoteproc: Prevent incorrect rproc state on xfer mem ownership failure

PATCH In review Sibi Sankar 2 participants 2 messages Apr 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: Prevent incorrect rproc state on xfer mem ownership failure

Any failure in the secure call for transferring mem ownership of mba region to Q6 would result in reporting that the remoteproc device is running. This is because the previous q6v5_clk_enable would have been a success. Prevent this by updating variable 'ret' accordingly.

---
 drivers/remoteproc/qcom_q6v5_pil.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_pil.c +3 -4
index 8e70a627e0bb..296eb3f8b551 100644
@@ -761,13 +761,12 @@ static int q6v5_start(struct rproc *rproc)
 	}
 
 	/* Assign MBA image access in DDR to q6 */
-	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
 						qproc->mba_phys,
 						qproc->mba_size);
-	if (xfermemop_ret) {
+	if (ret) {
 		dev_err(qproc->dev,
-			"assigning Q6 access to mba memory failed: %d\n",
-			xfermemop_ret);
+			"assigning Q6 access to mba memory failed: %d\n", ret);
 		goto disable_active_clks;
 	}
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 5 lines · Sibi Sankar

Any failure in the secure call for transferring mem ownership of mba region to Q6 would result in reporting that the remoteproc device is running. This is because the previous q6v5_clk_enable would have been a success. Prevent this by updating variable 'ret' accordingly.

Added Cc: [email protected] and applied, thanks.

Regards,
Bjorn

Quoted 30 lines
---
 drivers/remoteproc/qcom_q6v5_pil.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_pil.c +3 -4
index 8e70a627e0bb..296eb3f8b551 100644
@@ -761,13 +761,12 @@ static int q6v5_start(struct rproc *rproc)
 	}
 
 	/* Assign MBA image access in DDR to q6 */
-	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
 						qproc->mba_phys,
 						qproc->mba_size);
-	if (xfermemop_ret) {
+	if (ret) {
 		dev_err(qproc->dev,
-			"assigning Q6 access to mba memory failed: %d\n",
-			xfermemop_ret);
+			"assigning Q6 access to mba memory failed: %d\n", ret);
 		goto disable_active_clks;
 	}
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project