Skip to contentSkip to conversation

Don't call SCM interface for statically mapped msa region

PATCH Superseded Govind Singh 3 participants 7 messages Nov 11, 2019 – Dec 17, 2019

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Don't call SCM interface for statically mapped msa region

For some targets ex: SC7180/QCS404, SCM permissions for MSA region is statically configured in TrustZone fw. Add SCM call disable option for such targets to avoid duplicate permissions.

Change since v1:
Added devicetree list for review.

Govind Singh (2):
dt: bindings: add dt entry flag to skip SCM call for msa region
ath10k: Don't call SCM interface for statically mapped msa region

 .../devicetree/bindings/net/wireless/qcom,ath10k.txt     | 4 ++++
 drivers/net/wireless/ath/ath10k/qmi.c                    | 9 +++++++++
 drivers/net/wireless/ath/ath10k/qmi.h                    | 1 +
 3 files changed, 14 insertions(+)
Signature · 7 lines
2.22.0


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw

PATCH v2 1/2 dt: bindings: add dt entry flag to skip SCM call for msa region

Add boolean context flag to disable SCM call for statically mapped msa region.

---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt          | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +4 -0
index 017128394a3e..7ba22918bab7 100644
@@ -88,6 +88,9 @@ Optional properties:
 		    of the host capability QMI request
 - qcom,xo-cal-data: xo cal offset to be configured in xo trim register.
 
+- qcom,msa_fixed_perm: Boolean context flag to disable SCM call for statically
+		       mapped msa region.
+
 Example (to supply PCI based wifi block details):
 
 In this example, the node is defined as child node of the PCI controller.
@@ -185,4 +188,5 @@ wifi@18000000 {
 		vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
 		memory-region = <&wifi_msa_mem>;
 		iommus = <&apps_smmu 0x0040 0x1>;
+		qcom,msa_fixed_perm;
 };
Signature · 7 lines
2.22.0


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt: bindings: add dt entry flag to skip SCM call for msa region

Quoted 2 lines · Govind Singh

Add boolean context flag to disable SCM call for statically mapped msa region.

Can't this be implied by the compatible string?

Quoted 11 lines
---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt          | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +0 -0
index 017128394a3e..7ba22918bab7 100644

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt Optional properties: · line 93

Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +3 -0
@@ -88,6 +88,9 @@ Optional properties:
 		    of the host capability QMI request
 - qcom,xo-cal-data: xo cal offset to be configured in xo trim register.
 
+- qcom,msa_fixed_perm: Boolean context flag to disable SCM call for statically
+		       mapped msa region.
+

s/_/-/

Quoted 12 lines
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +1 -0
 Example (to supply PCI based wifi block details):
 
 In this example, the node is defined as child node of the PCI controller.
@@ -185,4 +188,5 @@ wifi@18000000 {
 		vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
 		memory-region = <&wifi_msa_mem>;
 		iommus = <&apps_smmu 0x0040 0x1>;
+		qcom,msa_fixed_perm;
 };
Signature · 1 line
2.22.0

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#3 lore raw

Re: [PATCH v2 1/2] dt: bindings: add dt entry flag to skip SCM call for msa region

Hi Rob,

Quoted 6 lines · Rob Herring
Quoted 2 lines · Govind Singh

Add boolean context flag to disable SCM call for statically mapped msa region.

Can't this be implied by the compatible string?

same soc compatible will be used in older TZ vs new TZ. Due to this reason I added this.

Quoted 25 lines
Quoted 18 lines
---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt          | 4 
++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +0 -0
index 017128394a3e..7ba22918bab7 100644
@@ -88,6 +88,9 @@ Optional properties:
 		    of the host capability QMI request
 - qcom,xo-cal-data: xo cal offset to be configured in xo trim 

register.

+- qcom,msa_fixed_perm: Boolean context flag to disable SCM call for statically

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt Optional properties: · line 93

Quoted 2 lines
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +2 -0
+		       mapped msa region.
+

s/_/-/

Quoted 2 lines

Example (to supply PCI based wifi block details):

Quoted 11 lines
Quoted 11 lines

In this example, the node is defined as child node of the PCI
controller.

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +1 -1
@@ -185,4 +188,5 @@ wifi@18000000 {
 		vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
 		memory-region = <&wifi_msa_mem>;
 		iommus = <&apps_smmu 0x0040 0x1>;
+		qcom,msa_fixed_perm;
 };
--

2.22.0

BR,
Govind

#4 lore raw

Re: [PATCH v2 1/2] dt: bindings: add dt entry flag to skip SCM call for msa region

In reply to Rob Herring

Hi Rob,

Quoted 6 lines · Rob Herring
Quoted 2 lines · Govind Singh

Add boolean context flag to disable SCM call for statically mapped msa region.

Can't this be implied by the compatible string?

same soc compatible will be used in older TZ vs new TZ. Due to this reason I added this.

Quoted 25 lines
Quoted 18 lines
---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt          | 4 
++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +0 -0
index 017128394a3e..7ba22918bab7 100644
@@ -88,6 +88,9 @@ Optional properties:
 		    of the host capability QMI request
 - qcom,xo-cal-data: xo cal offset to be configured in xo trim 

register.

+- qcom,msa_fixed_perm: Boolean context flag to disable SCM call for statically

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt Optional properties: · line 93

Quoted 2 lines
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +2 -0
+		       mapped msa region.
+

s/_/-/

Quoted 2 lines

Example (to supply PCI based wifi block details):

Quoted 11 lines
Quoted 11 lines

In this example, the node is defined as child node of the PCI
controller.

Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +1 -1
@@ -185,4 +188,5 @@ wifi@18000000 {
 		vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
 		memory-region = <&wifi_msa_mem>;
 		iommus = <&apps_smmu 0x0040 0x1>;
+		qcom,msa_fixed_perm;
 };
--

2.22.0

BR,
Govind

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#5 lore raw

Re: [PATCH v2 1/2] dt: bindings: add dt entry flag to skip SCM call for msa region

Quoted 10 lines · [email protected] writes:
Quoted 6 lines · Rob Herring
Quoted 2 lines · Govind Singh

Add boolean context flag to disable SCM call for statically mapped msa region.

Can't this be implied by the compatible string?

same soc compatible will be used in older TZ vs new TZ. Due to this reason I added this.

So what should we do? Rob, any suggestions?

Full patch here:

https://patchwork.kernel.org/patch/11236535/

Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#6 lore raw

PATCH v2 2/2 ath10k: Don't call SCM interface for statically mapped msa region

In reply to Govind Singh

For some targets ex: QCS404, SCM permissions for MSA region is statically configured in TrustZone fw. Add SCM call disable option for such targets to avoid duplicate permissions.

Testing: Tested on WCN3990 HW
Tested FW: WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1

---
 drivers/net/wireless/ath/ath10k/qmi.c | 9 +++++++++
 drivers/net/wireless/ath/ath10k/qmi.h | 1 +
 2 files changed, 10 insertions(+)
drivers/net/wireless/ath/ath10k/qmi.c +9 -0
index 637f83ef65f8..40ffc444ab7b 100644
@@ -84,6 +84,9 @@ static int ath10k_qmi_setup_msa_permissions(struct ath10k_qmi *qmi)
 	int ret;
 	int i;
 
+	if (qmi->msa_fixed_perm)
+		return 0;
+
 	for (i = 0; i < qmi->nr_mem_region; i++) {
 		ret = ath10k_qmi_map_msa_permission(qmi, &qmi->mem_region[i]);
 		if (ret)
@@ -102,6 +105,9 @@ static void ath10k_qmi_remove_msa_permission(struct ath10k_qmi *qmi)
 {
 	int i;
 
+	if (qmi->msa_fixed_perm)
+		return;
+
 	for (i = 0; i < qmi->nr_mem_region; i++)
 		ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]);
 }
@@ -1018,6 +1024,9 @@ static int ath10k_qmi_setup_msa_resources(struct ath10k_qmi *qmi, u32 msa_size)
 		qmi->msa_mem_size = msa_size;
 	}
 
+	if (of_property_read_bool(dev->of_node, "qcom,msa_fixed_perm"))
+		qmi->msa_fixed_perm = true;
+
 	ath10k_dbg(ar, ATH10K_DBG_QMI, "msa pa: %pad , msa va: 0x%p\n",
 		   &qmi->msa_pa,
 		   qmi->msa_va);
drivers/net/wireless/ath/ath10k/qmi.h +1 -0
index 40aafb875ed0..dc257375f161 100644
@@ -104,6 +104,7 @@ struct ath10k_qmi {
 	bool fw_ready;
 	char fw_build_timestamp[MAX_TIMESTAMP_LEN + 1];
 	struct ath10k_qmi_cal_data cal_data[MAX_NUM_CAL_V01];
+	bool msa_fixed_perm;
 };
 
 int ath10k_qmi_wlan_enable(struct ath10k *ar,
Signature · 7 lines
2.22.0


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k