LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA cold boot
@ 2020-09-15 17:37 Sibi Sankar
  2020-09-15 18:33 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Sibi Sankar @ 2020-09-15 17:37 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-remoteproc, linux-kernel, ohad,
	evgreen, swboyd, Sibi Sankar

On secure devices which support warm reset, the modem subsystem requires
access to the mpss region to clear them out. Hence assign the mpss region
to Q6 before MBA cold boot. This will be a nop during a modem SSR.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

I didn't want to add any new flags for warm reset support because
calling xfer for mpss to q6 shouldn't have any side effects on
platforms that don't support warm resets.

 drivers/remoteproc/qcom_q6v5_mss.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c401bcc263fa5..cc5b7edc02c73 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -931,6 +931,18 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 		goto assert_reset;
 	}
 
+	/**
+	 * On secure devices which support warm reboot, the modem subsystem's cold boot is similar
+	 * to an SSR sequence i.e the mba requires access to the modem memory to clear it out during
+	 * Q6 cold boot. For modem SSR it will be a nop.
+	 */
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false, true,
+				      qproc->mpss_phys, qproc->mpss_size);
+	if (ret) {
+		dev_err(qproc->dev, "assigning Q6 access to mpss memory failed: %d\n", ret);
+		goto disable_active_clks;
+	}
+
 	/* Assign MBA image access in DDR to q6 */
 	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, true,
 				      qproc->mba_phys, qproc->mba_size);
-- 
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: Assign mpss region to Q6 before MBA cold boot
  2020-09-15 17:37 [PATCH] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA cold boot Sibi Sankar
@ 2020-09-15 18:33 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2020-09-15 18:33 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: agross, linux-arm-msm, linux-remoteproc, linux-kernel, ohad,
	evgreen, swboyd

On Tue 15 Sep 17:37 UTC 2020, Sibi Sankar wrote:

> On secure devices which support warm reset, the modem subsystem requires
> access to the mpss region to clear them out. Hence assign the mpss region
> to Q6 before MBA cold boot. This will be a nop during a modem SSR.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> I didn't want to add any new flags for warm reset support because
> calling xfer for mpss to q6 shouldn't have any side effects on
> platforms that don't support warm resets.
> 

As discussed offline, I don't see a problem with unconditionally handing
over the ownership of the region during this time frame. So let's just
generalize the comment below a little bit and I'm happy with this
change.

Thanks,
Bjorn

>  drivers/remoteproc/qcom_q6v5_mss.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index c401bcc263fa5..cc5b7edc02c73 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -931,6 +931,18 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  		goto assert_reset;
>  	}
>  
> +	/**
> +	 * On secure devices which support warm reboot, the modem subsystem's cold boot is similar
> +	 * to an SSR sequence i.e the mba requires access to the modem memory to clear it out during
> +	 * Q6 cold boot. For modem SSR it will be a nop.
> +	 */
> +	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false, true,
> +				      qproc->mpss_phys, qproc->mpss_size);
> +	if (ret) {
> +		dev_err(qproc->dev, "assigning Q6 access to mpss memory failed: %d\n", ret);
> +		goto disable_active_clks;
> +	}
> +
>  	/* Assign MBA image access in DDR to q6 */
>  	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, true,
>  				      qproc->mba_phys, qproc->mba_size);
> -- 
> 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

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-09-15 17:37 [PATCH] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA cold boot Sibi Sankar
2020-09-15 18:33 ` Bjorn Andersson

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

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

Example config snippet for mirrors

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


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