diff mbox series

arm64: dts: qcom: sc7280: Mark FastRPC context banks as dma-coherent

Message ID 20250416-sc7280-fastrpc-dma-v1-1-60ca91116b1e@radxa.com
State New
Headers show
Series arm64: dts: qcom: sc7280: Mark FastRPC context banks as dma-coherent | expand

Commit Message

Xilin Wu April 16, 2025, 10:54 a.m. UTC
The FastRPC context banks are DMA-coherent on sc7280 platform. Mark them
as such.

This allows LLM inferencing on the CDSP using Qualcomm AI Engine Direct
SDK on the qcs6490 platform.

Signed-off-by: Xilin Wu <sophon@radxa.com>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)


---
base-commit: 5b37f7bfff3b1582c34be8fb23968b226db71ebd
change-id: 20250416-sc7280-fastrpc-dma-88f3471a4113

Best regards,

Comments

Bjorn Andersson May 20, 2025, 2:14 a.m. UTC | #1
On Wed, 16 Apr 2025 18:54:18 +0800, Xilin Wu wrote:
> The FastRPC context banks are DMA-coherent on sc7280 platform. Mark them
> as such.
> 
> This allows LLM inferencing on the CDSP using Qualcomm AI Engine Direct
> SDK on the qcs6490 platform.
> 
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: sc7280: Mark FastRPC context banks as dma-coherent
      commit: 2a49326081e1e5f08e0e6d65a1632652ee11a319

Best regards,
Dmitry Baryshkov May 20, 2025, 9:34 p.m. UTC | #2
On Wed, Apr 16, 2025 at 06:54:18PM +0800, Xilin Wu wrote:
> The FastRPC context banks are DMA-coherent on sc7280 platform. Mark them
> as such.
> 
> This allows LLM inferencing on the CDSP using Qualcomm AI Engine Direct
> SDK on the qcs6490 platform.
> 
> Signed-off-by: Xilin Wu <sophon@radxa.com>
> ---
>  arch/arm64/boot/dts/qcom/sc7280.dtsi | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)

Are context banks coherent on FP5? On Herobrine? Or Nothing Phone?
Xilin Wu May 21, 2025, 2:08 p.m. UTC | #3
On 2025/5/21 05:34:08, Dmitry Baryshkov wrote:
> On Wed, Apr 16, 2025 at 06:54:18PM +0800, Xilin Wu wrote:
>> The FastRPC context banks are DMA-coherent on sc7280 platform. Mark them
>> as such.
>>
>> This allows LLM inferencing on the CDSP using Qualcomm AI Engine Direct
>> SDK on the qcs6490 platform.
>>
>> Signed-off-by: Xilin Wu <sophon@radxa.com>
>> ---
>>   arch/arm64/boot/dts/qcom/sc7280.dtsi | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
> 
> Are context banks coherent on FP5? On Herobrine? Or Nothing Phone?
> 

Hi,

This was tested on an upcoming SBC (Radxa Dragon Q6A) with the Qualcomm 
Linux cdsp firmware. There would be an error in the LLM demo app without 
this patch.

I'm honestly not sure about the devices that you mentioned, since I 
don't have any other sc7280 devices to test.
Dmitry Baryshkov May 21, 2025, 2:52 p.m. UTC | #4
On 21/05/2025 17:08, Xilin Wu wrote:
> On 2025/5/21 05:34:08, Dmitry Baryshkov wrote:
>> On Wed, Apr 16, 2025 at 06:54:18PM +0800, Xilin Wu wrote:
>>> The FastRPC context banks are DMA-coherent on sc7280 platform. Mark them
>>> as such.
>>>
>>> This allows LLM inferencing on the CDSP using Qualcomm AI Engine Direct
>>> SDK on the qcs6490 platform.
>>>
>>> Signed-off-by: Xilin Wu <sophon@radxa.com>
>>> ---
>>>   arch/arm64/boot/dts/qcom/sc7280.dtsi | 15 +++++++++++++++
>>>   1 file changed, 15 insertions(+)
>>
>> Are context banks coherent on FP5? On Herobrine? Or Nothing Phone?
>>
> 
> Hi,
> 
> This was tested on an upcoming SBC (Radxa Dragon Q6A) with the Qualcomm 
> Linux cdsp firmware. There would be an error in the LLM demo app without 
> this patch.
> 
> I'm honestly not sure about the devices that you mentioned, since I 
> don't have any other sc7280 devices to test.

You have enabled dma-coherency for the several families of devices using 
SC7280, QCM/QCS6490 and SM7350. Some of them might have older firmware, 
etc. We had this issue with SDM845 / RB3 boards.

Bjorn, do we need to revert this patch? See corresponding discussion at 
https://lore.kernel.org/linux-arm-msm/70ffec25-17c9-4424-9d0b-da6560f7160d@quicinc.com
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index ec96c917b56b4a077b45ac0186da6aaedb899dbe..bb5092bc2bbe97ece31ad84a22f87738b1289682 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3869,18 +3869,21 @@  compute-cb@3 {
 						compatible = "qcom,fastrpc-compute-cb";
 						reg = <3>;
 						iommus = <&apps_smmu 0x1803 0x0>;
+						dma-coherent;
 					};
 
 					compute-cb@4 {
 						compatible = "qcom,fastrpc-compute-cb";
 						reg = <4>;
 						iommus = <&apps_smmu 0x1804 0x0>;
+						dma-coherent;
 					};
 
 					compute-cb@5 {
 						compatible = "qcom,fastrpc-compute-cb";
 						reg = <5>;
 						iommus = <&apps_smmu 0x1805 0x0>;
+						dma-coherent;
 					};
 				};
 			};
@@ -4108,6 +4111,7 @@  compute-cb@1 {
 						reg = <1>;
 						iommus = <&apps_smmu 0x11a1 0x0420>,
 							 <&apps_smmu 0x1181 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@2 {
@@ -4115,6 +4119,7 @@  compute-cb@2 {
 						reg = <2>;
 						iommus = <&apps_smmu 0x11a2 0x0420>,
 							 <&apps_smmu 0x1182 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@3 {
@@ -4122,6 +4127,7 @@  compute-cb@3 {
 						reg = <3>;
 						iommus = <&apps_smmu 0x11a3 0x0420>,
 							 <&apps_smmu 0x1183 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@4 {
@@ -4129,6 +4135,7 @@  compute-cb@4 {
 						reg = <4>;
 						iommus = <&apps_smmu 0x11a4 0x0420>,
 							 <&apps_smmu 0x1184 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@5 {
@@ -4136,6 +4143,7 @@  compute-cb@5 {
 						reg = <5>;
 						iommus = <&apps_smmu 0x11a5 0x0420>,
 							 <&apps_smmu 0x1185 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@6 {
@@ -4143,6 +4151,7 @@  compute-cb@6 {
 						reg = <6>;
 						iommus = <&apps_smmu 0x11a6 0x0420>,
 							 <&apps_smmu 0x1186 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@7 {
@@ -4150,6 +4159,7 @@  compute-cb@7 {
 						reg = <7>;
 						iommus = <&apps_smmu 0x11a7 0x0420>,
 							 <&apps_smmu 0x1187 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@8 {
@@ -4157,6 +4167,7 @@  compute-cb@8 {
 						reg = <8>;
 						iommus = <&apps_smmu 0x11a8 0x0420>,
 							 <&apps_smmu 0x1188 0x0420>;
+						dma-coherent;
 					};
 
 					/* note: secure cb9 in downstream */
@@ -4166,6 +4177,7 @@  compute-cb@11 {
 						reg = <11>;
 						iommus = <&apps_smmu 0x11ab 0x0420>,
 							 <&apps_smmu 0x118b 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@12 {
@@ -4173,6 +4185,7 @@  compute-cb@12 {
 						reg = <12>;
 						iommus = <&apps_smmu 0x11ac 0x0420>,
 							 <&apps_smmu 0x118c 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@13 {
@@ -4180,6 +4193,7 @@  compute-cb@13 {
 						reg = <13>;
 						iommus = <&apps_smmu 0x11ad 0x0420>,
 							 <&apps_smmu 0x118d 0x0420>;
+						dma-coherent;
 					};
 
 					compute-cb@14 {
@@ -4187,6 +4201,7 @@  compute-cb@14 {
 						reg = <14>;
 						iommus = <&apps_smmu 0x11ae 0x0420>,
 							 <&apps_smmu 0x118e 0x0420>;
+						dma-coherent;
 					};
 				};
 			};