2020-08-24 16:46:27

by Anilkumar Kolli

[permalink] [raw]
Subject: [PATCH v6 2/3] ath11k: copy ce service configs to hw_params

No functional changes, added target ce service configurations to hw_params.

Signed-off-by: Anilkumar Kolli <[email protected]>
---
V3:
- added ce svc configs in hw_params

drivers/net/wireless/ath/ath11k/ahb.c | 14 +++++++++-----
drivers/net/wireless/ath/ath11k/core.c | 6 ------
drivers/net/wireless/ath/ath11k/hw.h | 2 ++
3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 8466c62a83d6..a45a7d62f283 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -159,7 +159,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
* This table is derived from the CE_PCI TABLE, above.
* It is passed to the Target at startup for use by firmware.
*/
-static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
+static const struct service_to_pipe target_service_to_ce_map_wlan_ipq8074[] = {
{
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
@@ -579,8 +579,8 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)

cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
cfg->tgt_ce = target_ce_config_wlan;
- cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan);
- cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
+ cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
+ cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074;
}

@@ -789,8 +789,8 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id
bool ul_set = false, dl_set = false;
int i;

- for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
- entry = &target_service_to_ce_map_wlan[i];
+ for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
+ entry = &ab->hw_params.svc_to_ce_map[i];

if (__le32_to_cpu(entry->service_id) != service_id)
continue;
@@ -890,6 +890,10 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
goto err_hal_srng_deinit;
}

+ ab->hw_params.svc_to_ce_map_len =
+ ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+ ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074;
+
ath11k_ahb_init_qmi_ce_config(ab);

ret = ath11k_core_init(ab);
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 437b1123a34f..61a6f395c436 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -812,12 +812,6 @@ int ath11k_core_init(struct ath11k_base *ab)
return ret;
}

- ret = ath11k_init_hw_params(ab);
- if (ret) {
- ath11k_err(ab, "failed to get hw params %d\n", ret);
- return ret;
- }
-
ret = ath11k_core_soc_create(ab);
if (ret) {
ath11k_err(ab, "failed to create soc core: %d\n", ret);
diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index d15fa7fd6d5d..ebe691cb4a13 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -129,6 +129,8 @@ struct ath11k_hw_params {
} fw;

const struct ath11k_hw_ops *hw_ops;
+ const struct service_to_pipe *svc_to_ce_map;
+ int svc_to_ce_map_len;

const struct ath11k_hw_ring_mask *ring_mask;

--
2.7.4


2020-09-07 10:00:10

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v6 2/3] ath11k: copy ce service configs to hw_params

Anilkumar Kolli <[email protected]> writes:

> No functional changes, added target ce service configurations to hw_params.
>
> Signed-off-by: Anilkumar Kolli <[email protected]>

[...]

> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -812,12 +812,6 @@ int ath11k_core_init(struct ath11k_base *ab)
> return ret;
> }
>
> - ret = ath11k_init_hw_params(ab);
> - if (ret) {
> - ath11k_err(ab, "failed to get hw params %d\n", ret);
> - return ret;
> - }

This is very suspicious.

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

2020-09-07 11:15:13

by Anilkumar Kolli

[permalink] [raw]
Subject: Re: [PATCH v6 2/3] ath11k: copy ce service configs to hw_params

On 2020-09-07 15:28, Kalle Valo wrote:
> Anilkumar Kolli <[email protected]> writes:
>
>> No functional changes, added target ce service configurations to
>> hw_params.
>>
>> Signed-off-by: Anilkumar Kolli <[email protected]>
>
> [...]
>
>> --- a/drivers/net/wireless/ath/ath11k/core.c
>> +++ b/drivers/net/wireless/ath/ath11k/core.c
>> @@ -812,12 +812,6 @@ int ath11k_core_init(struct ath11k_base *ab)
>> return ret;
>> }
>>
>> - ret = ath11k_init_hw_params(ab);
>> - if (ret) {
>> - ath11k_err(ab, "failed to get hw params %d\n", ret);
>> - return ret;
>> - }
>
> This is very suspicious.

ath11k_core_pre_init() is calling ath11k_init_hw_params(), again calling
same function in ath11k_core_init()
is not needed. Will send this as a new patch ?

Thanks
Anil

2020-09-07 16:26:09

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v6 2/3] ath11k: copy ce service configs to hw_params

[email protected] writes:

> On 2020-09-07 15:28, Kalle Valo wrote:
>> Anilkumar Kolli <[email protected]> writes:
>>
>>> No functional changes, added target ce service configurations to
>>> hw_params.
>>>
>>> Signed-off-by: Anilkumar Kolli <[email protected]>
>>
>> [...]
>>
>>> --- a/drivers/net/wireless/ath/ath11k/core.c
>>> +++ b/drivers/net/wireless/ath/ath11k/core.c
>>> @@ -812,12 +812,6 @@ int ath11k_core_init(struct ath11k_base *ab)
>>> return ret;
>>> }
>>>
>>> - ret = ath11k_init_hw_params(ab);
>>> - if (ret) {
>>> - ath11k_err(ab, "failed to get hw params %d\n", ret);
>>> - return ret;
>>> - }
>>
>> This is very suspicious.
>
> ath11k_core_pre_init() is calling ath11k_init_hw_params(), again
> calling same function in ath11k_core_init() is not needed.
>
> Will send this as a new patch ?

Yes, please send this in a new patch with a proper commit log explaining
the situation.

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