diff mbox series

[3/3] ath11k: set correct NL80211_FEATURE_DYNAMIC_SMPS for WCN6855

Message ID 20210914163726.38604-3-jouni@codeaurora.org (mailing list archive)
State Accepted
Commit 82c434c103408842a87404e873992b7698b6df2b
Delegated to: Kalle Valo
Headers show
Series [1/3] ath11k: Change number of TCL rings to one for QCA6390 | expand

Commit Message

Jouni Malinen Sept. 14, 2021, 4:37 p.m. UTC
From: Wen Gong <wgong@codeaurora.org>

Commit "ath11k: support SMPS configuration for 6 GHz" changed "if
(ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6
GHz. However, WCN6855 supports 6 GHz but it does not support feature
NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures
for WCN6855.

Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does
not support WMI_HT_CAP_DYNAMIC_SMPS.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/core.c | 1 +
 drivers/net/wireless/ath/ath11k/hw.h   | 1 +
 drivers/net/wireless/ath/ath11k/mac.c  | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

Comments

Kalle Valo Sept. 16, 2021, 10:08 a.m. UTC | #1
Jouni Malinen <jouni@codeaurora.org> writes:

> From: Wen Gong <wgong@codeaurora.org>
>
> Commit "ath11k: support SMPS configuration for 6 GHz" changed "if
> (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
> WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
> NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6
> GHz. However, WCN6855 supports 6 GHz but it does not support feature
> NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures
> for WCN6855.
>
> Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does
> not support WMI_HT_CAP_DYNAMIC_SMPS.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>

[...]

> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -7570,7 +7570,8 @@ static int __ath11k_mac_register(struct ath11k *ar)
>  	 * for each band for a dual band capable radio. It will be tricky to
>  	 * handle it when the ht capability different for each band.
>  	 */
> -	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
> +	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
> +	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
>  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
>  
>  	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;

This hunk failed, in the pending branch as I don't have that
ar->supports_6ghz check. I'll drop this patch 3 for now, let's revisit
after my queue of ath11k patches is smaller.
Wen Gong Sept. 16, 2021, 2:09 p.m. UTC | #2
On 2021-09-16 18:08, Kalle Valo wrote:
> Jouni Malinen <jouni@codeaurora.org> writes:
> 
>> From: Wen Gong <wgong@codeaurora.org>
>> 
>> Commit "ath11k: support SMPS configuration for 6 GHz" changed "if
>> (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
>> WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
>> NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6
>> GHz. However, WCN6855 supports 6 GHz but it does not support feature
>> NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test 
>> failures
>> for WCN6855.
>> 
>> Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does
>> not support WMI_HT_CAP_DYNAMIC_SMPS.
>> 
>> Tested-on: WCN6855 hw2.0 PCI 
>> WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>> 
>> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
> 
> [...]
> 
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -7570,7 +7570,8 @@ static int __ath11k_mac_register(struct ath11k 
>> *ar)
>>  	 * for each band for a dual band capable radio. It will be tricky to
>>  	 * handle it when the ht capability different for each band.
>>  	 */
>> -	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
>> +	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
>> +	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
>>  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
>> 
>>  	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
> 
> This hunk failed, in the pending branch as I don't have that
> ar->supports_6ghz check. I'll drop this patch 3 for now, let's revisit
> after my queue of ath11k patches is smaller.
Hi Kalle,

ar->supports_6ghz is introduced by this patch:
https://patchwork.kernel.org/project/linux-wireless/patch/20210913175510.193005-3-jouni@codeaurora.org/

@@ -7559,7 +7570,7 @@  static int __ath11k_mac_register(struct ath11k 
*ar)
  	 * for each band for a dual band capable radio. It will be tricky to
  	 * handle it when the ht capability different for each band.
  	 */
-	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)
+	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;

  	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
Kalle Valo Sept. 16, 2021, 3:15 p.m. UTC | #3
Wen Gong <wgong@codeaurora.org> writes:

> On 2021-09-16 18:08, Kalle Valo wrote:
>> Jouni Malinen <jouni@codeaurora.org> writes:
>>
>>> From: Wen Gong <wgong@codeaurora.org>
>>>
>>> Commit "ath11k: support SMPS configuration for 6 GHz" changed "if
>>> (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
>>> WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
>>> NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6
>>> GHz. However, WCN6855 supports 6 GHz but it does not support feature
>>> NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test
>>> failures
>>> for WCN6855.
>>>
>>> Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does
>>> not support WMI_HT_CAP_DYNAMIC_SMPS.
>>>
>>> Tested-on: WCN6855 hw2.0 PCI
>>> WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>>>
>>> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>>> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
>>
>> [...]
>>
>>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>>> @@ -7570,7 +7570,8 @@ static int __ath11k_mac_register(struct
>>> ath11k *ar)
>>>  	 * for each band for a dual band capable radio. It will be tricky to
>>>  	 * handle it when the ht capability different for each band.
>>>  	 */
>>> -	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
>>> +	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
>>> +	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
>>>  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
>>>
>>>  	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
>>
>> This hunk failed, in the pending branch as I don't have that
>> ar->supports_6ghz check. I'll drop this patch 3 for now, let's revisit
>> after my queue of ath11k patches is smaller.
>
> ar->supports_6ghz is introduced by this patch:
> https://patchwork.kernel.org/project/linux-wireless/patch/20210913175510.193005-3-jouni@codeaurora.org/

Ah, and that was in Awaiting Upstream state and not yet in my pending
branch. I'll take that patchset first to pending branch and then apply
this patch 3, so no need to resend anything (at least for the moment).
Kalle Valo Oct. 28, 2021, 10:07 a.m. UTC | #4
Jouni Malinen <jouni@codeaurora.org> writes:

> From: Wen Gong <wgong@codeaurora.org>
>
> Commit "ath11k: support SMPS configuration for 6 GHz" changed "if
> (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
> WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
> NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6
> GHz. However, WCN6855 supports 6 GHz but it does not support feature
> NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures
> for WCN6855.
>
> Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does
> not support WMI_HT_CAP_DYNAMIC_SMPS.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath11k/core.c | 1 +
>  drivers/net/wireless/ath/ath11k/hw.h   | 1 +
>  drivers/net/wireless/ath/ath11k/mac.c  | 3 ++-
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index 265ff225bd81..2bae8c5184d4 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -279,6 +279,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
>  		.sram_dump = &sram_dump_wcn6855,
>  		.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
>  		.hal_params = &ath11k_hal_params_qca6390,
> +		.check_dynamic_smps = true,
>  	},
>  };
>  
> diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
> index c6831fb110ba..7463b96770b7 100644
> --- a/drivers/net/wireless/ath/ath11k/hw.h
> +++ b/drivers/net/wireless/ath/ath11k/hw.h
> @@ -180,6 +180,7 @@ struct ath11k_hw_params {
>  	const struct ath11k_hw_sram_dump *sram_dump;
>  	u8 max_tx_ring;
>  	const struct hal_param *hal_params;
> +	bool check_dynamic_smps;
>  };
>  
>  struct ath11k_hw_ops {
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
> index 1f4765e43546..97a2c92b7b9b 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -7570,7 +7570,8 @@ static int __ath11k_mac_register(struct ath11k *ar)
>  	 * for each band for a dual band capable radio. It will be tricky to
>  	 * handle it when the ht capability different for each band.
>  	 */
> -	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
> +	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
> +	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
>  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;

Instead of a "negative" flag I reverted the test and renamed the flag to
supports_dynamic_smps_6ghz. AFAIK QCN9074 is the only device supporting
6 GHz band so I enabled the flag only for it.

Please review my changes in the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=cc692cfb9f2981691b39b601b37e4544ecf01136
Wen Gong Oct. 29, 2021, 2:30 a.m. UTC | #5
On 2021-10-28 18:07, Kalle Valo wrote:
> Jouni Malinen <jouni@codeaurora.org> writes:
> 
>> From: Wen Gong <wgong@codeaurora.org>
>> 
...
>> diff --git a/drivers/net/wireless/ath/ath11k/mac.c 
>> b/drivers/net/wireless/ath/ath11k/mac.c
>> index 1f4765e43546..97a2c92b7b9b 100644
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -7570,7 +7570,8 @@ static int __ath11k_mac_register(struct ath11k 
>> *ar)
>>  	 * for each band for a dual band capable radio. It will be tricky to
>>  	 * handle it when the ht capability different for each band.
>>  	 */
>> -	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
>> +	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
>> +	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
>>  		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
> 
> Instead of a "negative" flag I reverted the test and renamed the flag 
> to
> supports_dynamic_smps_6ghz. AFAIK QCN9074 is the only device supporting
> 6 GHz band so I enabled the flag only for it.
> 
> Please review my changes in the pending branch:
Thanks.
the change is OK for WCN6855/QCA6390.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=cc692cfb9f2981691b39b601b37e4544ecf01136
Kalle Valo Nov. 1, 2021, 2:13 p.m. UTC | #6
Jouni Malinen <jouni@codeaurora.org> wrote:

> Commit 6f4d70308e5e ("ath11k: support SMPS configuration for 6 GHz") changed
> "if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
> WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
> NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6 GHz.
> However, WCN6855 supports 6 GHz but it does not support feature
> NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures for
> WCN6855.
> 
> Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does not
> support WMI_HT_CAP_DYNAMIC_SMPS. Enable the feature only on QCN9074 as that's
> the only other device supporting 6 GHz band.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

82c434c10340 ath11k: set correct NL80211_FEATURE_DYNAMIC_SMPS for WCN6855
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 265ff225bd81..2bae8c5184d4 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -279,6 +279,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.sram_dump = &sram_dump_wcn6855,
 		.max_tx_ring = DP_TCL_NUM_RING_MAX_QCA6390,
 		.hal_params = &ath11k_hal_params_qca6390,
+		.check_dynamic_smps = true,
 	},
 };
 
diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index c6831fb110ba..7463b96770b7 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -180,6 +180,7 @@  struct ath11k_hw_params {
 	const struct ath11k_hw_sram_dump *sram_dump;
 	u8 max_tx_ring;
 	const struct hal_param *hal_params;
+	bool check_dynamic_smps;
 };
 
 struct ath11k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 1f4765e43546..97a2c92b7b9b 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7570,7 +7570,8 @@  static int __ath11k_mac_register(struct ath11k *ar)
 	 * for each band for a dual band capable radio. It will be tricky to
 	 * handle it when the ht capability different for each band.
 	 */
-	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)
+	if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
+	    (ar->supports_6ghz && !ab->hw_params.check_dynamic_smps))
 		ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
 
 	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;