All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] qcom: scm: fix cp_adsp_shared vmid and assignment on sdm660
@ 2026-11-24 16:52 Nickolay Goppen
  2026-11-24 16:52 ` [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value Nickolay Goppen
  2026-11-24 16:52 ` [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment Nickolay Goppen
  0 siblings, 2 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-24 16:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta
  Cc: linux-arm-msm, devicetree, Konrad Dybcio, Nickolay Goppen,
	Gianluca Boiano

In previous commit adding CP_ADSP_SHARED vmid the mistake has been made
in interpretation of vmid value, downstream sets it in decimal, but 
upstream sets it in hex, so fix this mistake by changing vmid value.
Also fix vmid assignment on sdm660 adsp.

Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
Gianluca Boiano (2):
      dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value
      arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment

 arch/arm64/boot/dts/qcom/sdm630.dtsi    | 3 +--
 include/dt-bindings/firmware/qcom,scm.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
---
base-commit: 3191063649dbf7c0d0b768e1f3655e4c5fc6edb5
change-id: 20261124-qcom-adsp-shared-vmid-fixes-9bc381c4372a

Best regards,
--  
Nickolay Goppen <setotau@mainlining.org>

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

* [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value
  2026-11-24 16:52 [PATCH 0/2] qcom: scm: fix cp_adsp_shared vmid and assignment on sdm660 Nickolay Goppen
@ 2026-11-24 16:52 ` Nickolay Goppen
  2026-11-25  8:29   ` Krzysztof Kozlowski
  2026-11-24 16:52 ` [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment Nickolay Goppen
  1 sibling, 1 reply; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-24 16:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta
  Cc: linux-arm-msm, devicetree, Konrad Dybcio, Nickolay Goppen,
	Gianluca Boiano

From: Gianluca Boiano <morf3089@gmail.com>

CP_ADSP_SHARED was taken from downstream AC_VM_ADSP_HEAP_SHARED, which
is defined there as decimal 33, i.e. 0x21, not 0x33.

TZ on SDM636 accepts assigning the ADSP heap to 0x21 and rejects 0x33
with -EINVAL.

Fixes: db6ae6650cfd ("dt-bindings: firmware: qcom: scm: add CP_ADSP_SHARED VMID")
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
 include/dt-bindings/firmware/qcom,scm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dt-bindings/firmware/qcom,scm.h b/include/dt-bindings/firmware/qcom,scm.h
index 0d29d8d4829c..9b86ac8f1029 100644
--- a/include/dt-bindings/firmware/qcom,scm.h
+++ b/include/dt-bindings/firmware/qcom,scm.h
@@ -28,6 +28,7 @@
 #define QCOM_SCM_VMID_CP_SPSS_SP	0x1A
 #define QCOM_SCM_VMID_CP_CAMERA_PREVIEW 0x1D
 #define QCOM_SCM_VMID_CDSP		0x1E
+#define QCOM_SCM_VMID_CP_ADSP_SHARED	0x21
 #define QCOM_SCM_VMID_CP_SPSS_SP_SHARED 0x22
 #define QCOM_SCM_VMID_CP_SPSS_HLOS_SHARED 0x24
 #define QCOM_SCM_VMID_ADSP_HEAP		0x25
@@ -35,6 +36,5 @@
 #define QCOM_SCM_VMID_NAV		0x2B
 #define QCOM_SCM_VMID_TVM		0x2D
 #define QCOM_SCM_VMID_OEMVM		0x31
-#define QCOM_SCM_VMID_CP_ADSP_SHARED	0x33
 
 #endif

-- 
2.56.1

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

* [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment
  2026-11-24 16:52 [PATCH 0/2] qcom: scm: fix cp_adsp_shared vmid and assignment on sdm660 Nickolay Goppen
  2026-11-24 16:52 ` [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value Nickolay Goppen
@ 2026-11-24 16:52 ` Nickolay Goppen
  2026-11-24 17:07   ` sashiko-bot
  1 sibling, 1 reply; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-24 16:52 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta
  Cc: linux-arm-msm, devicetree, Konrad Dybcio, Nickolay Goppen,
	Gianluca Boiano

From: Gianluca Boiano <morf3089@gmail.com>

Downstream assigns the ADSP remote heap to AC_VM_ADSP_HEAP_SHARED only,
without HLOS. TZ rejects HLOS + CP_ADSP_SHARED with -EINVAL; since
commit 6a502776f4a4 ("misc: fastrpc: check qcom_scm_assign_mem()
return in rpmsg_probe") that fails the probe and rpmsg retries it
endlessly.

Assign the heap to CP_ADSP_SHARED only, as downstream does.

Tested on xiaomi-tulip (SDM636), destination VMIDs:

  CP_ADSP_SHARED (0x21)       ok
  HLOS + CP_ADSP_SHARED       -EINVAL
  ADSP_HEAP, ADSP_Q6          -EINVAL

Fixes: dc11a2824f05 ("arm64: dts: qcom: sdm630: assign adsp_mem region to ADSP FastRPC node")
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
 arch/arm64/boot/dts/qcom/sdm630.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi
index 20225732e4a8..327a8049f707 100644
--- a/arch/arm64/boot/dts/qcom/sdm630.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi
@@ -2477,8 +2477,7 @@ fastrpc {
 					qcom,glink-channels = "fastrpcglink-apps-dsp";
 					label = "adsp";
 					memory-region = <&adsp_mem>;
-					qcom,vmids = <QCOM_SCM_VMID_HLOS
-						      QCOM_SCM_VMID_CP_ADSP_SHARED>;
+					qcom,vmids = <QCOM_SCM_VMID_CP_ADSP_SHARED>;
 					qcom,non-secure-domain;
 					#address-cells = <1>;
 					#size-cells = <0>;

-- 
2.56.1

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

* Re: [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment
  2026-11-24 16:52 ` [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment Nickolay Goppen
@ 2026-11-24 17:07   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-24 17:07 UTC (permalink / raw)
  To: Nickolay Goppen; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] arm64: dts: qcom: sdm630: adsp_mem left reusable after revoking
  HLOS VMID
--

commit 4c51ed0e779228db4d03e3924b592519e72060d8
Author: Gianluca Boiano <morf3089@gmail.com>

arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment

This commit removes QCOM_SCM_VMID_HLOS from the ADSP FastRPC node's
qcom,vmids property in sdm630.dtsi so that qcom_scm_assign_mem() succeeds
when assigning the adsp_mem heap to QCOM_SCM_VMID_CP_ADSP_SHARED.

> diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi
> index 20225732e4a80..327a8049f7072 100644
> --- a/arch/arm64/boot/dts/qcom/sdm630.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi
> @@ -2477,8 +2477,7 @@ fastrpc {
>  					qcom,glink-channels = "fastrpcglink-apps-dsp";
>  					label = "adsp";
>  					memory-region = <&adsp_mem>;
> -					qcom,vmids = <QCOM_SCM_VMID_HLOS
> -						      QCOM_SCM_VMID_CP_ADSP_SHARED>;
> +					qcom,vmids = <QCOM_SCM_VMID_CP_ADSP_SHARED>;

[Severity: High]
Should adsp_mem in sdm630.dtsi be changed from reusable to no-map now
that QCOM_SCM_VMID_HLOS is removed here?

arch/arm64/boot/dts/qcom/sdm630.dtsi:
    ...
		adsp_mem: adsp-region {
			compatible = "shared-dma-pool";
			alloc-ranges = <0x0 0x80000000 0x0 0x80000000>;
			alignment = <0x0 0x400000>;
			size = <0x0 0x800000>;
			reusable;
		};
    ...

During fastrpc_rpmsg_probe(), fastrpc_init_reserved_mem() calls
qcom_scm_assign_mem() on the raw adsp_mem resource range without
allocating its pages from CMA, revoking HLOS stage-2 permissions across
the 8 MiB region.  Because adsp_mem is marked reusable, it remains in the
kernel linear map and CMA continues lending its pages to the buddy
allocator for movable allocations, causing a stage-2 access fault or
memory corruption between Linux and the ADSP remote heap when those pages
are accessed.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-qcom-adsp-shared-vmid-fixes-v1-0-f1a808dc41a5@mainlining.org?part=2

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

* Re: [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value
  2026-11-24 16:52 ` [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value Nickolay Goppen
@ 2026-11-25  8:29   ` Krzysztof Kozlowski
  2026-11-26 14:17     ` Nickolay Goppen
  2026-12-02 21:18     ` Bjorn Andersson
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-25  8:29 UTC (permalink / raw)
  To: Nickolay Goppen
  Cc: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta,
	linux-arm-msm, devicetree, Konrad Dybcio, Gianluca Boiano,
	Krzysztof Kozlowski

On 2026-11-24 19:52 +0300, Nickolay Goppen wrote:
> From: Gianluca Boiano <morf3089@gmail.com>
> 
> CP_ADSP_SHARED was taken from downstream AC_VM_ADSP_HEAP_SHARED, which
> is defined there as decimal 33, i.e. 0x21, not 0x33.
> 
> TZ on SDM636 accepts assigning the ADSP heap to 0x21 and rejects 0x33
> with -EINVAL.

So not a binding? The value is abstract, just fix firmware... even the
drivers are not really treating this as DT ABI.

Anyway, any ABI break must be explicit in commit msg, better with
explanation what was actually not working.



Best regards,
Krzysztof

-- 
Krzysztof Kozlowski <krzk@kernel.org>

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

* Re: [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value
  2026-11-25  8:29   ` Krzysztof Kozlowski
@ 2026-11-26 14:17     ` Nickolay Goppen
  2026-12-02 21:18     ` Bjorn Andersson
  1 sibling, 0 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-26 14:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta,
	linux-arm-msm, devicetree, Konrad Dybcio, Gianluca Boiano


25.11.2026 11:29, Krzysztof Kozlowski пишет:
> On 2026-11-24 19:52 +0300, Nickolay Goppen wrote:
>> From: Gianluca Boiano <morf3089@gmail.com>
>>
>> CP_ADSP_SHARED was taken from downstream AC_VM_ADSP_HEAP_SHARED, which
>> is defined there as decimal 33, i.e. 0x21, not 0x33.
>>
>> TZ on SDM636 accepts assigning the ADSP heap to 0x21 and rejects 0x33
>> with -EINVAL.
> So not a binding? The value is abstract, just fix firmware... even the
> drivers are not really treating this as DT ABI.
>
> Anyway, any ABI break must be explicit in commit msg, better with
> explanation what was actually not working.
>
A mentioned misinterpreted vmid value leads to probe loop as tz rejects 
this value and probe fails
>
> Best regards,
> Krzysztof
>
-- 
Best regards,
Nickolay

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

* Re: [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value
  2026-11-25  8:29   ` Krzysztof Kozlowski
  2026-11-26 14:17     ` Nickolay Goppen
@ 2026-12-02 21:18     ` Bjorn Andersson
  1 sibling, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2026-12-02 21:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Nickolay Goppen, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov, Ekansh Gupta,
	linux-arm-msm, devicetree, Konrad Dybcio, Gianluca Boiano

On Wed, Nov 25, 2026 at 09:29:19AM +0100, Krzysztof Kozlowski wrote:
> On 2026-11-24 19:52 +0300, Nickolay Goppen wrote:
> > From: Gianluca Boiano <morf3089@gmail.com>
> > 
> > CP_ADSP_SHARED was taken from downstream AC_VM_ADSP_HEAP_SHARED, which
> > is defined there as decimal 33, i.e. 0x21, not 0x33.
> > 
> > TZ on SDM636 accepts assigning the ADSP heap to 0x21 and rejects 0x33
> > with -EINVAL.
> 
> So not a binding? The value is abstract, just fix firmware... even the
> drivers are not really treating this as DT ABI.
> 

This is not DT ABI, it's a enumeration of firmware/hardware constants.

But it's used both in DeviceTree (qcom,vmids property) and some drivers
and thereby ended up in include/dt-bindings to be reused between the
two.

> Anyway, any ABI break must be explicit in commit msg, better with
> explanation what was actually not working.
> 

Per the commit message this isn't an ABI breakage, but a copy-paste
error in the header file.

Regards,
Bjorn

> 
> 
> Best regards,
> Krzysztof
> 
> -- 
> Krzysztof Kozlowski <krzk@kernel.org>

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

end of thread, other threads:[~2026-12-02 21:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 16:52 [PATCH 0/2] qcom: scm: fix cp_adsp_shared vmid and assignment on sdm660 Nickolay Goppen
2026-11-24 16:52 ` [PATCH 1/2] dt-bindings: firmware: qcom: scm: fix CP_ADSP_SHARED VMID value Nickolay Goppen
2026-11-25  8:29   ` Krzysztof Kozlowski
2026-11-26 14:17     ` Nickolay Goppen
2026-12-02 21:18     ` Bjorn Andersson
2026-11-24 16:52 ` [PATCH 2/2] arm64: dts: qcom: sdm630: fix ADSP FastRPC heap assignment Nickolay Goppen
2026-11-24 17:07   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.