Skip to content

Commit 265d0ce

Browse files
authored
Merge pull request #162 from Realzhq/6.18
UPSTREAM: wifi: ath12k: Address issues during beacon stats retrieval
2 parents bb04523 + 597aa8b commit 265d0ce

5 files changed

Lines changed: 14 additions & 25 deletions

File tree

drivers/net/wireless/ath/ath12k/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: BSD-3-Clause-Clear
22
/*
33
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
54
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
65
*/
76

@@ -1250,7 +1249,6 @@ void ath12k_fw_stats_reset(struct ath12k *ar)
12501249
spin_lock_bh(&ar->data_lock);
12511250
ath12k_fw_stats_free(&ar->fw_stats);
12521251
ar->fw_stats.num_vdev_recvd = 0;
1253-
ar->fw_stats.num_bcn_recvd = 0;
12541252
spin_unlock_bh(&ar->data_lock);
12551253
}
12561254

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@ struct ath12k_fw_stats {
644644
struct list_head vdevs;
645645
struct list_head bcn;
646646
u32 num_vdev_recvd;
647-
u32 num_bcn_recvd;
648647
};
649648

650649
struct ath12k_dbg_htt_stats {

drivers/net/wireless/ath/ath12k/debugfs.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ static int ath12k_open_vdev_stats(struct inode *inode, struct file *file)
12831283

12841284
ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id,
12851285
buf);
1286+
ath12k_fw_stats_reset(ar);
12861287

12871288
file->private_data = no_free_ptr(buf);
12881289

@@ -1349,12 +1350,7 @@ static int ath12k_open_bcn_stats(struct inode *inode, struct file *file)
13491350

13501351
ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id,
13511352
buf);
1352-
/* since beacon stats request is looped for all active VDEVs, saved fw
1353-
* stats is not freed for each request until done for all active VDEVs
1354-
*/
1355-
spin_lock_bh(&ar->data_lock);
1356-
ath12k_fw_stats_bcn_free(&ar->fw_stats.bcn);
1357-
spin_unlock_bh(&ar->data_lock);
1353+
ath12k_fw_stats_reset(ar);
13581354

13591355
file->private_data = no_free_ptr(buf);
13601356

@@ -1415,6 +1411,7 @@ static int ath12k_open_pdev_stats(struct inode *inode, struct file *file)
14151411

14161412
ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id,
14171413
buf);
1414+
ath12k_fw_stats_reset(ar);
14181415

14191416
file->private_data = no_free_ptr(buf);
14201417

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4837,8 +4837,6 @@ int ath12k_mac_get_fw_stats(struct ath12k *ar,
48374837
if (ah->state != ATH12K_HW_STATE_ON)
48384838
return -ENETDOWN;
48394839

4840-
ath12k_fw_stats_reset(ar);
4841-
48424840
reinit_completion(&ar->fw_stats_complete);
48434841
reinit_completion(&ar->fw_stats_done);
48444842

@@ -4936,6 +4934,7 @@ static int ath12k_mac_op_get_txpower(struct ieee80211_hw *hw,
49364934
ar->chan_tx_pwr = pdev->chan_tx_power / 2;
49374935
spin_unlock_bh(&ar->data_lock);
49384936
ar->last_tx_power_update = jiffies;
4937+
ath12k_fw_stats_reset(ar);
49394938

49404939
send_tx_power:
49414940
*dbm = ar->chan_tx_pwr;
@@ -12701,14 +12700,18 @@ static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
1270112700

1270212701
if (!signal &&
1270312702
ahsta->ahvif->vdev_type == WMI_VDEV_TYPE_STA &&
12704-
!(ath12k_mac_get_fw_stats(ar, &params)))
12703+
!(ath12k_mac_get_fw_stats(ar, &params))) {
1270512704
signal = arsta->rssi_beacon;
12705+
ath12k_fw_stats_reset(ar);
12706+
}
1270612707

1270712708
params.stats_id = WMI_REQUEST_RSSI_PER_CHAIN_STAT;
1270812709
if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL)) &&
1270912710
ahsta->ahvif->vdev_type == WMI_VDEV_TYPE_STA &&
12710-
!(ath12k_mac_get_fw_stats(ar, &params)))
12711+
!(ath12k_mac_get_fw_stats(ar, &params))) {
1271112712
ath12k_mac_put_chain_rssi(sinfo, arsta);
12713+
ath12k_fw_stats_reset(ar);
12714+
}
1271212715

1271312716
spin_lock_bh(&ar->data_lock);
1271412717
noise_floor = ath12k_pdev_get_noise_floor(ar);
@@ -12792,8 +12795,10 @@ static void ath12k_mac_op_link_sta_statistics(struct ieee80211_hw *hw,
1279212795

1279312796
if (!signal &&
1279412797
ahsta->ahvif->vdev_type == WMI_VDEV_TYPE_STA &&
12795-
!(ath12k_mac_get_fw_stats(ar, &params)))
12798+
!(ath12k_mac_get_fw_stats(ar, &params))) {
1279612799
signal = arsta->rssi_beacon;
12800+
ath12k_fw_stats_reset(ar);
12801+
}
1279712802

1279812803
if (signal) {
1279912804
link_sinfo->signal =

drivers/net/wireless/ath/ath12k/wmi.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8017,8 +8017,6 @@ void ath12k_wmi_fw_stats_dump(struct ath12k *ar,
80178017
buf[len - 1] = 0;
80188018
else
80198019
buf[len] = 0;
8020-
8021-
ath12k_fw_stats_reset(ar);
80228020
}
80238021

80248022
static void
@@ -8415,18 +8413,10 @@ static void ath12k_wmi_fw_stats_process(struct ath12k *ar,
84158413
ath12k_warn(ab, "empty beacon stats");
84168414
return;
84178415
}
8418-
/* Mark end until we reached the count of all started VDEVs
8419-
* within the PDEV
8420-
*/
8421-
if (ar->num_started_vdevs)
8422-
is_end = ((++ar->fw_stats.num_bcn_recvd) ==
8423-
ar->num_started_vdevs);
84248416

84258417
list_splice_tail_init(&stats->bcn,
84268418
&ar->fw_stats.bcn);
8427-
8428-
if (is_end)
8429-
complete(&ar->fw_stats_done);
8419+
complete(&ar->fw_stats_done);
84308420
}
84318421
}
84328422

0 commit comments

Comments
 (0)