Linux-remoteproc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completion
@ 2020-07-16 12:05 Sibi Sankar
  2020-07-18  0:20 ` patchwork-bot+linux-remoteproc
  0 siblings, 1 reply; 2+ messages in thread
From: Sibi Sankar @ 2020-07-16 12:05 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-remoteproc, linux-kernel, evgreen,
	ohad, Sibi Sankar

On secure devices there exists a race condition which could lock the MSS
CONFIG AHB bus thus preventing access to BOOT_STATUS register during SSR.
Switch to polling the MSS_STATUS register with an additional 10 us delay
to reliably track boot completion.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index a9ba5f38a58ed..13c6d5a72a831 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -113,8 +113,6 @@
 #define QDSP6SS_SLEEP                   0x3C
 #define QDSP6SS_BOOT_CORE_START         0x400
 #define QDSP6SS_BOOT_CMD                0x404
-#define QDSP6SS_BOOT_STATUS		0x408
-#define BOOT_STATUS_TIMEOUT_US		200
 #define BOOT_FSM_TIMEOUT                10000
 
 struct reg_info {
@@ -580,13 +578,15 @@ static int q6v5proc_reset(struct q6v5 *qproc)
 		/* De-assert the Q6 stop core signal */
 		writel(1, qproc->reg_base + QDSP6SS_BOOT_CORE_START);
 
+		/* Wait for 10 us for any staggering logic to settle */
+		usleep_range(10, 20);
+
 		/* Trigger the boot FSM to start the Q6 out-of-reset sequence */
 		writel(1, qproc->reg_base + QDSP6SS_BOOT_CMD);
 
-		/* Poll the QDSP6SS_BOOT_STATUS for FSM completion */
-		ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_BOOT_STATUS,
-					 val, (val & BIT(0)) != 0, 1,
-					 BOOT_STATUS_TIMEOUT_US);
+		/* Poll the MSS_STATUS for FSM completion */
+		ret = readl_poll_timeout(qproc->rmb_base + RMB_MBA_MSS_STATUS,
+					 val, (val & BIT(0)) != 0, 10, BOOT_FSM_TIMEOUT);
 		if (ret) {
 			dev_err(qproc->dev, "Boot FSM failed to complete.\n");
 			/* Reset the modem so that boot FSM is in reset state */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completion
  2020-07-16 12:05 [PATCH] remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completion Sibi Sankar
@ 2020-07-18  0:20 ` patchwork-bot+linux-remoteproc
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-07-18  0:20 UTC (permalink / raw)
  To: Sibi Sankar; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next).

On Thu, 16 Jul 2020 17:35:14 +0530 you wrote:
> On secure devices there exists a race condition which could lock the MSS
> CONFIG AHB bus thus preventing access to BOOT_STATUS register during SSR.
> Switch to polling the MSS_STATUS register with an additional 10 us delay
> to reliably track boot completion.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> 
> [...]


Here is a summary with links:
  - remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completion
    https://git.kernel.org/andersson/remoteproc/c/4e6751a1cfab85b7a1c054cf3d55f12322e1ee3b

You are awesome, thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 12:05 [PATCH] remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completion Sibi Sankar
2020-07-18  0:20 ` patchwork-bot+linux-remoteproc

Linux-remoteproc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-remoteproc/0 linux-remoteproc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-remoteproc linux-remoteproc/ https://lore.kernel.org/linux-remoteproc \
		linux-remoteproc@vger.kernel.org
	public-inbox-index linux-remoteproc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-remoteproc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git