2019-10-23 09:41:28

by Govind Singh

[permalink] [raw]
Subject: [PATCH 0/2] 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.

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(+)

--
2.22.0


2019-10-23 09:41:28

by Govind Singh

[permalink] [raw]
Subject: [PATCH 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.

Signed-off-by: Govind Singh <[email protected]>
---
.../devicetree/bindings/net/wireless/qcom,ath10k.txt | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index 81859507db67..0d868443375d 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -83,6 +83,9 @@ Optional properties:
and "sky85803" etc.
- 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.
@@ -180,4 +183,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

2019-10-23 09:42:39

by Govind Singh

[permalink] [raw]
Subject: [PATCH 2/2] ath10k: Don't call SCM interface for statically mapped msa region

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

Signed-off-by: Govind Singh <[email protected]>
---
drivers/net/wireless/ath/ath10k/qmi.c | 9 +++++++++
drivers/net/wireless/ath/ath10k/qmi.h | 1 +
2 files changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c
index da16874012c5..d43ec0183287 100644
--- a/drivers/net/wireless/ath/ath10k/qmi.c
+++ b/drivers/net/wireless/ath/ath10k/qmi.c
@@ -95,6 +95,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)
@@ -113,6 +116,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]);
}
@@ -1021,6 +1027,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);
diff --git a/drivers/net/wireless/ath/ath10k/qmi.h b/drivers/net/wireless/ath/ath10k/qmi.h
index 4ab21b223aaf..3a039e6e29df 100644
--- a/drivers/net/wireless/ath/ath10k/qmi.h
+++ b/drivers/net/wireless/ath/ath10k/qmi.h
@@ -115,6 +115,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,
--
2.22.0

2019-10-24 20:54:18

by Kalle Valo

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

Govind Singh <[email protected]> writes:

> Add boolean context flag to disable SCM call for statically
> mapped msa region.
>
> Signed-off-by: Govind Singh <[email protected]>

Oddly this didn't apply, but 3-way merge did work. Please double check
the result in the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=master-pending&id=6f308524cf602ed9a0dbb0b0b50ba625b9091879

--
Kalle Valo

2019-10-25 09:19:01

by Govind Singh

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

Hi Kalle,

On 2019-10-24 12:44, Kalle Valo wrote:
> Govind Singh <[email protected]> writes:
>
>> Add boolean context flag to disable SCM call for statically
>> mapped msa region.
>>
>> Signed-off-by: Govind Singh <[email protected]>
>
> Oddly this didn't apply, but 3-way merge did work. Please double check
> the result in the pending branch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=master-pending&id=6f308524cf602ed9a0dbb0b0b50ba625b9091879

Change looks good to me.


BR,
Govind

2019-11-08 08:39:58

by Kalle Valo

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

Govind Singh <[email protected]> wrote:

> Add boolean context flag to disable SCM call for statically
> mapped msa region.
>
> Signed-off-by: Govind Singh <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

I was wondering why there are no review comments from DT folks and then
noticed that you didn't CC the devicetree list. Please resend (as v2)
and CC devicetree list.

2 patches set to Changes Requested.

11206177 [1/2] dt: bindings: add dt entry flag to skip SCM call for msa region
11206179 [2/2] ath10k: Don't call SCM interface for statically mapped msa region

--
https://patchwork.kernel.org/patch/11206177/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches