LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot
@ 2020-09-16 14:52 Sibi Sankar
  2020-09-16 17:17 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Sibi Sankar @ 2020-09-16 14:52 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 MBA firmware requires
access to the modem region to clear them out. Hence provide Q6 access
to this region before MBA boot. This will be a nop during a modem SSR.

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

V2:
 * Fixup comments as suggested by Bjorn. 

 drivers/remoteproc/qcom_q6v5_mss.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c401bcc263fa..f989ca81d374 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 		goto assert_reset;
 	}
 
+	/* Some versions of the MBA firmware will upon boot wipe the MPSS region as well, so provide
+	 * the Q6 access to this region.
+	 */
+	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);
@@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 
 	/**
 	 * In case of a modem subsystem restart on secure devices, the modem
-	 * memory can be reclaimed only after MBA is loaded. For modem cold
-	 * boot this will be a nop
+	 * memory can be reclaimed only after MBA is loaded.
 	 */
 	q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, true, false,
 				qproc->mpss_phys, qproc->mpss_size);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH v2] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot
  2020-09-16 14:52 [PATCH v2] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot Sibi Sankar
@ 2020-09-16 17:17 ` Stephen Boyd
  2020-09-17 15:59   ` Sibi Sankar
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2020-09-16 17:17 UTC (permalink / raw)
  To: Sibi Sankar, bjorn.andersson
  Cc: agross, linux-arm-msm, linux-remoteproc, linux-kernel, ohad,
	evgreen, Sibi Sankar

Quoting Sibi Sankar (2020-09-16 07:52:52)
> On secure devices which support warm reset, the MBA firmware requires
> access to the modem region to clear them out. Hence provide Q6 access
> to this region before MBA boot. This will be a nop during a modem SSR.
> 

Does it need a Fixes: tag? Probably.

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

Trivia time!

> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index c401bcc263fa..f989ca81d374 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>                 goto assert_reset;
>         }
>  
> +       /* Some versions of the MBA firmware will upon boot wipe the MPSS region as well, so provide

Should have /* on a line by itself.

> +        * the Q6 access to this region.
> +        */
> +       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);
> @@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  
>         /**

Should be /* instead of /**, the latter is for kernel-doc which this is
not.

>          * In case of a modem subsystem restart on secure devices, the modem
> -        * memory can be reclaimed only after MBA is loaded. For modem cold
> -        * boot this will be a nop
> +        * memory can be reclaimed only after MBA is loaded.
>          */
>         q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, true, false,
>                                 qproc->mpss_phys, qproc->mpss_size);

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

* Re: [PATCH v2] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot
  2020-09-16 17:17 ` Stephen Boyd
@ 2020-09-17 15:59   ` Sibi Sankar
  0 siblings, 0 replies; 3+ messages in thread
From: Sibi Sankar @ 2020-09-17 15:59 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: bjorn.andersson, agross, linux-arm-msm, linux-remoteproc,
	linux-kernel, ohad, evgreen, linux-arm-msm-owner

Stephen,
Thanks for taking time to review the
series.

On 2020-09-16 22:47, Stephen Boyd wrote:
> Quoting Sibi Sankar (2020-09-16 07:52:52)
>> On secure devices which support warm reset, the MBA firmware requires
>> access to the modem region to clear them out. Hence provide Q6 access
>> to this region before MBA boot. This will be a nop during a modem SSR.
>> 
> 
> Does it need a Fixes: tag? Probably.

it doesn't really fix anything previously
committed. When SC7180 support was added,
mss driver still lacked secure boot support
and when Bjorn added secure boot support,
none of the secure devices necessarily
supported warm reset. So I'll skip adding
fixes tag.

> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
> 
> Trivia time!
> 
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
>> b/drivers/remoteproc/qcom_q6v5_mss.c
>> index c401bcc263fa..f989ca81d374 100644
>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>> @@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>>                 goto assert_reset;
>>         }
>> 
>> +       /* Some versions of the MBA firmware will upon boot wipe the 
>> MPSS region as well, so provide
> 
> Should have /* on a line by itself.
> 
>> +        * the Q6 access to this region.
>> +        */
>> +       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);
>> @@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>> 
>>         /**
> 
> Should be /* instead of /**, the latter is for kernel-doc which this is
> not.

sure I'll get ^^ done in the next
re-spin.

> 
>>          * In case of a modem subsystem restart on secure devices, the 
>> modem
>> -        * memory can be reclaimed only after MBA is loaded. For modem 
>> cold
>> -        * boot this will be a nop
>> +        * memory can be reclaimed only after MBA is loaded.
>>          */
>>         q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, true, false,
>>                                 qproc->mpss_phys, qproc->mpss_size);

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 14:52 [PATCH v2] remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot Sibi Sankar
2020-09-16 17:17 ` Stephen Boyd
2020-09-17 15:59   ` Sibi Sankar

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