Skip to content

Commit 597aa8b

Browse files
Manish DharanenthiranRealzhq
authored andcommitted
UPSTREAM: wifi: ath12k: Fix timeout error during beacon stats retrieval
Currently, for beacon_stats, ath12k_mac_get_fw_stats() is called for each started BSS on the specified hardware. ath12k_mac_get_fw_stats() will wait for the fw_stats_done completion after fetching the requested data from firmware. For the beacon_stats, fw_stats_done completion will be set only when stats are received for all BSSes. However, for other stats like vdev_stats or pdev_stats, there is one request to the firmware for all enabled BSSes. Since beacon_stats is fetched individually for all BSSes enabled in that pdev, waiting for the completion event results in a timeout error when multiple BSSes are enabled. Avoid this by completing the fw_stats_done immediately after updating the requested BSS's beacon stats in the list. Subsequently, this list will be used to display the beacon stats for all enabled BSSes in the requested pdev. Additionally, remove 'num_bcn_recvd' from the ath12k_fw_stats struct as it is no longer needed. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Fixes: 9fe4669 ("wifi: ath12k: Request beacon stats from firmware") Signed-off-by: Manish Dharanenthiran <manish.dharanenthiran@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Signed-off-by: Qian Zhang <qian.zhang@oss.qualcomm.com> Link: https://lore.kernel.org/all/20251031-beacon_stats-v1-2-f52fce7b03ac@qti.qualcomm.com/
1 parent ed30fd7 commit 597aa8b

3 files changed

Lines changed: 1 addition & 12 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/wmi.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8413,18 +8413,10 @@ static void ath12k_wmi_fw_stats_process(struct ath12k *ar,
84138413
ath12k_warn(ab, "empty beacon stats");
84148414
return;
84158415
}
8416-
/* Mark end until we reached the count of all started VDEVs
8417-
* within the PDEV
8418-
*/
8419-
if (ar->num_started_vdevs)
8420-
is_end = ((++ar->fw_stats.num_bcn_recvd) ==
8421-
ar->num_started_vdevs);
84228416

84238417
list_splice_tail_init(&stats->bcn,
84248418
&ar->fw_stats.bcn);
8425-
8426-
if (is_end)
8427-
complete(&ar->fw_stats_done);
8419+
complete(&ar->fw_stats_done);
84288420
}
84298421
}
84308422

0 commit comments

Comments
 (0)