diff mbox series

[v6,5/5] wifi: ath12k: Disable MLO in Factory Test Mode

Message ID 20250109183551.1028791-6-quic_aarasahu@quicinc.com (mailing list archive)
State New
Delegated to: Kalle Valo
Headers show
Series wifi: ath12k: Factory test mode support | expand

Commit Message

Aaradhana Sahu Jan. 9, 2025, 6:35 p.m. UTC
Factory test mode(FTM) is supported only non-mlo(multi-link operation)
mode. Therefore, disable MLO when driver boots in FTM mode.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/core.c | 5 ++---
 drivers/net/wireless/ath/ath12k/qmi.c  | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Jeff Johnson Jan. 9, 2025, 9 p.m. UTC | #1
On 1/9/2025 10:35 AM, Aaradhana Sahu wrote:
> Factory test mode(FTM) is supported only non-mlo(multi-link operation)

only *in* non-mlo...?

and s/-mlo/-MLO/

> mode. Therefore, disable MLO when driver boots in FTM mode.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Aditya Kumar Singh Jan. 10, 2025, 4:59 a.m. UTC | #2
On 1/10/25 00:05, Aaradhana Sahu wrote:
> Factory test mode(FTM) is supported only non-mlo(multi-link operation)
> mode. Therefore, disable MLO when driver boots in FTM mode.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
> ---
>   drivers/net/wireless/ath/ath12k/core.c | 5 ++---
>   drivers/net/wireless/ath/ath12k/qmi.c  | 4 ++--
>   2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index d0cf82ca6dae..6705e33074aa 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -1630,10 +1630,9 @@ static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *a
>   			return NULL;
>   		}
>   
> -		if (ath12k_core_get_wsi_info(ag, ab) ||
> +		if (ath12k_ftm_mode || ath12k_core_get_wsi_info(ag, ab) ||
>   		    ath12k_core_get_wsi_index(ag, ab)) {
> -			ath12k_dbg(ab, ATH12K_DBG_BOOT,
> -				   "unable to get wsi info from dt, grouping single device");
> +			ath12k_dbg(ab, ATH12K_DBG_BOOT, "grouping single device");
>   			ag->id = ATH12K_INVALID_GROUP_ID;
>   			ag->num_devices = 1;

Why to even bother and check group list to see if a grp already exist
and if not then create a grp and then check ftm_mode?

I think better would be to have something like below?

--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1598,6 +1598,9 @@ static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *a
  
         lockdep_assert_held(&ath12k_hw_group_mutex);
  
+       if (ath12k_ftm_mode)
+               goto invalid_group;
+
         /* The grouping of multiple devices will be done based on device tree file.
          * The platforms that do not have any valid group information would have
          * each device to be part of its own invalid group.


>   			memset(ag->wsi_node, 0, sizeof(ag->wsi_node));
> diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
> index 5c3563383fab..344c12b3b937 100644
> --- a/drivers/net/wireless/ath/ath12k/qmi.c
> +++ b/drivers/net/wireless/ath/ath12k/qmi.c
> @@ -1,7 +1,7 @@
>   // SPDX-License-Identifier: BSD-3-Clause-Clear
>   /*
>    * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
>    */
>   
>   #include <linux/elf.h>
> @@ -2265,7 +2265,7 @@ static void ath12k_qmi_phy_cap_send(struct ath12k_base *ab)
>   		goto out;
>   	}
>   
> -	if (resp.single_chip_mlo_support_valid &&
> +	if (!ath12k_ftm_mode && resp.single_chip_mlo_support_valid &&
>   	    resp.single_chip_mlo_support)
>   		ab->single_chip_mlo_supp = true;
>   

Better place would be to set ag->mlo_capable as false in
ath12k_core_hw_group_set_mlo_capable() ?
Aaradhana Sahu Jan. 10, 2025, 5:58 a.m. UTC | #3
On 1/10/2025 2:30 AM, Jeff Johnson wrote:
> On 1/9/2025 10:35 AM, Aaradhana Sahu wrote:
>> Factory test mode(FTM) is supported only non-mlo(multi-link operation)
> 
> only *in* non-mlo...?
> 
> and s/-mlo/-MLO/
> 
Sure, will address in the next version.

>> mode. Therefore, disable MLO when driver boots in FTM mode.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
>
Aaradhana Sahu Jan. 10, 2025, 5:59 a.m. UTC | #4
On 1/10/2025 10:29 AM, Aditya Kumar Singh wrote:
> On 1/10/25 00:05, Aaradhana Sahu wrote:
>> Factory test mode(FTM) is supported only non-mlo(multi-link operation)
>> mode. Therefore, disable MLO when driver boots in FTM mode.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
>> ---
>>   drivers/net/wireless/ath/ath12k/core.c | 5 ++---
>>   drivers/net/wireless/ath/ath12k/qmi.c  | 4 ++--
>>   2 files changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
>> index d0cf82ca6dae..6705e33074aa 100644
>> --- a/drivers/net/wireless/ath/ath12k/core.c
>> +++ b/drivers/net/wireless/ath/ath12k/core.c
>> @@ -1630,10 +1630,9 @@ static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *a
>>               return NULL;
>>           }
>>   -        if (ath12k_core_get_wsi_info(ag, ab) ||
>> +        if (ath12k_ftm_mode || ath12k_core_get_wsi_info(ag, ab) ||
>>               ath12k_core_get_wsi_index(ag, ab)) {
>> -            ath12k_dbg(ab, ATH12K_DBG_BOOT,
>> -                   "unable to get wsi info from dt, grouping single device");
>> +            ath12k_dbg(ab, ATH12K_DBG_BOOT, "grouping single device");
>>               ag->id = ATH12K_INVALID_GROUP_ID;
>>               ag->num_devices = 1;
> 
> Why to even bother and check group list to see if a grp already exist
> and if not then create a grp and then check ftm_mode?
> 
> I think better would be to have something like below?
> 
Sure, Thanks for suggestion.

> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -1598,6 +1598,9 @@ static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *a
>  
>         lockdep_assert_held(&ath12k_hw_group_mutex);
>  
> +       if (ath12k_ftm_mode)
> +               goto invalid_group;
> +
>         /* The grouping of multiple devices will be done based on device tree file.
>          * The platforms that do not have any valid group information would have
>          * each device to be part of its own invalid group.
> 
> 
>>               memset(ag->wsi_node, 0, sizeof(ag->wsi_node));
>> diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
>> index 5c3563383fab..344c12b3b937 100644
>> --- a/drivers/net/wireless/ath/ath12k/qmi.c
>> +++ b/drivers/net/wireless/ath/ath12k/qmi.c
>> @@ -1,7 +1,7 @@
>>   // SPDX-License-Identifier: BSD-3-Clause-Clear
>>   /*
>>    * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
>> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
>> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
>>    */
>>     #include <linux/elf.h>
>> @@ -2265,7 +2265,7 @@ static void ath12k_qmi_phy_cap_send(struct ath12k_base *ab)
>>           goto out;
>>       }
>>   -    if (resp.single_chip_mlo_support_valid &&
>> +    if (!ath12k_ftm_mode && resp.single_chip_mlo_support_valid &&
>>           resp.single_chip_mlo_support)
>>           ab->single_chip_mlo_supp = true;
>>   
> 
> Better place would be to set ag->mlo_capable as false in
> ath12k_core_hw_group_set_mlo_capable() ?
> 
Sure, will address in the next version.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index d0cf82ca6dae..6705e33074aa 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1630,10 +1630,9 @@  static struct ath12k_hw_group *ath12k_core_hw_group_assign(struct ath12k_base *a
 			return NULL;
 		}
 
-		if (ath12k_core_get_wsi_info(ag, ab) ||
+		if (ath12k_ftm_mode || ath12k_core_get_wsi_info(ag, ab) ||
 		    ath12k_core_get_wsi_index(ag, ab)) {
-			ath12k_dbg(ab, ATH12K_DBG_BOOT,
-				   "unable to get wsi info from dt, grouping single device");
+			ath12k_dbg(ab, ATH12K_DBG_BOOT, "grouping single device");
 			ag->id = ATH12K_INVALID_GROUP_ID;
 			ag->num_devices = 1;
 			memset(ag->wsi_node, 0, sizeof(ag->wsi_node));
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 5c3563383fab..344c12b3b937 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -1,7 +1,7 @@ 
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/elf.h>
@@ -2265,7 +2265,7 @@  static void ath12k_qmi_phy_cap_send(struct ath12k_base *ab)
 		goto out;
 	}
 
-	if (resp.single_chip_mlo_support_valid &&
+	if (!ath12k_ftm_mode && resp.single_chip_mlo_support_valid &&
 	    resp.single_chip_mlo_support)
 		ab->single_chip_mlo_supp = true;