2024-05-07 05:00:27

by Harshitha Prem

[permalink] [raw]
Subject: [PATCH v4 5/8] wifi: ath12k: move ATH12K_FLAG_REGISTERED flag set to mac_register api

From: Karthikeyan Periyasamy <[email protected]>

When hardware device group abstraction is introduced, in future, a group
abstraction is registered to mac80211 rather than a particular device.
Hence, setting ATH12K_FLAG_REGISTERED in QMI firmware ready event might not
be ideal.

Add changes to move set/unset of ATH12K_FLAG_REGISTERED flag inside
ath12k_mac_register() and ath12k_mac_unregister() respectively.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Signed-off-by: Harshitha Prem <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 2 ++
drivers/net/wireless/ath/ath12k/qmi.c | 4 +---
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 2e0bd7cfc7bf..ada4569fbff4 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8893,6 +8893,7 @@ int ath12k_mac_register(struct ath12k_base *ab)
goto err;
}

+ set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
return 0;

err:
@@ -8912,6 +8913,7 @@ void ath12k_mac_unregister(struct ath12k_base *ab)
struct ath12k_hw *ah;
int i;

+ clear_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
for (i = ath12k_get_num_hw(ab) - 1; i >= 0; i--) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah)
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 19a03cf8c391..b3a8459ab4e5 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -3333,11 +3333,9 @@ static void ath12k_qmi_driver_event_work(struct work_struct *work)
&ab->dev_flags);
clear_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags);
ret = ath12k_core_qmi_firmware_ready(ab);
- if (!ret) {
+ if (!ret)
set_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE,
&ab->dev_flags);
- set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
- }

break;
default:
--
2.34.1



2024-05-10 02:17:52

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH v4 5/8] wifi: ath12k: move ATH12K_FLAG_REGISTERED flag set to mac_register api

On 5/6/2024 9:56 PM, Harshitha Prem wrote:
> From: Karthikeyan Periyasamy <[email protected]>
>
> When hardware device group abstraction is introduced, in future, a group
> abstraction is registered to mac80211 rather than a particular device.
> Hence, setting ATH12K_FLAG_REGISTERED in QMI firmware ready event might not
> be ideal.
>
> Add changes to move set/unset of ATH12K_FLAG_REGISTERED flag inside
> ath12k_mac_register() and ath12k_mac_unregister() respectively.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
> Signed-off-by: Harshitha Prem <[email protected]>
Acked-by: Jeff Johnson <[email protected]>