]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Fix timeout error during beacon stats retrieval
authorManish Dharanenthiran <manish.dharanenthiran@oss.qualcomm.com>
Fri, 31 Oct 2025 03:07:46 +0000 (08:37 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 6 Nov 2025 15:33:31 +0000 (07:33 -0800)
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: 9fe4669ae919 ("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>
Link: https://patch.msgid.link/20251031-beacon_stats-v1-2-f52fce7b03ac@qti.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.c
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/wmi.c

index a2137b363c2fea4deef724b682c1e41788777c06..cc352eef1939937ce902bee2fbd9737ca3ab5993 100644 (file)
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
@@ -1250,7 +1249,6 @@ void ath12k_fw_stats_reset(struct ath12k *ar)
        spin_lock_bh(&ar->data_lock);
        ath12k_fw_stats_free(&ar->fw_stats);
        ar->fw_stats.num_vdev_recvd = 0;
-       ar->fw_stats.num_bcn_recvd = 0;
        spin_unlock_bh(&ar->data_lock);
 }
 
index 41da0efaa85478fbe294f958cbcf458b5ca07204..3c1e0069be1e77007245cec2cb289212c12baf4a 100644 (file)
@@ -646,7 +646,6 @@ struct ath12k_fw_stats {
        struct list_head vdevs;
        struct list_head bcn;
        u32 num_vdev_recvd;
-       u32 num_bcn_recvd;
 };
 
 struct ath12k_dbg_htt_stats {
index f812da24b21e68893327d61fe0ff9deb222bd54b..be8b2943094f8f4a12d625189c11315f1397e42d 100644 (file)
@@ -8485,18 +8485,10 @@ static void ath12k_wmi_fw_stats_process(struct ath12k *ar,
                        ath12k_warn(ab, "empty beacon stats");
                        return;
                }
-               /* Mark end until we reached the count of all started VDEVs
-                * within the PDEV
-                */
-               if (ar->num_started_vdevs)
-                       is_end = ((++ar->fw_stats.num_bcn_recvd) ==
-                                 ar->num_started_vdevs);
 
                list_splice_tail_init(&stats->bcn,
                                      &ar->fw_stats.bcn);
-
-               if (is_end)
-                       complete(&ar->fw_stats_done);
+               complete(&ar->fw_stats_done);
        }
 }