From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: m.limarencko@yandex.ru, jjohnson@kernel.org
Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH ath-next v2 2/4] wifi: ath12k: avoid long fw_stats waits on vdev stats hot path
Date: Thu, 26 Feb 2026 09:50:26 +0800 [thread overview]
Message-ID: <34363bc5-2439-4579-8999-67dedded39d0@oss.qualcomm.com> (raw)
In-Reply-To: <20260212121746.329619-3-m.limarencko@yandex.ru>
On 2/12/2026 8:17 PM, m.limarencko@yandex.ru wrote:
> From: Mikhail Limarenko <m.limarencko@yandex.ru>
>
> Station info requests can trigger frequent VDEV stat pulls from
>
> user space (iw/NM polling).
>
> On affected firmware, waiting 3 seconds for fw_stats_done causes
>
> repeated stalls and visible hitches.
>
> Use a short timeout for VDEV_STAT requests and skip unnecessary
>
> waits for stats types that do not need completion
>
> synchronization.
once again, can you please try
https://lore.kernel.org/ath12k/20260129-ath12k-fw-stats-fixes-v1-0-55d66064f4d5@oss.qualcomm.com/
>
> Tested-on: QCNFA765 (WCN785x), kernel 6.18.5+deb13-amd64
> Signed-off-by: Mikhail Limarenko <m.limarencko@yandex.ru>
> ---
> drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index 095b49a..1b550e9 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -4829,6 +4829,7 @@ int ath12k_mac_get_fw_stats(struct ath12k *ar,
> {
> struct ath12k_base *ab = ar->ab;
> struct ath12k_hw *ah = ath12k_ar_to_ah(ar);
> + unsigned long done_timeout = 3 * HZ;
> unsigned long time_left;
> int ret;
>
> @@ -4859,15 +4860,32 @@ int ath12k_mac_get_fw_stats(struct ath12k *ar,
> return -ETIMEDOUT;
> }
>
> + /* VDEV stats are queried frequently from station info paths (e.g. iw/NM).
> + * On buggy firmware this path can timeout repeatedly and block callers for
> + * multiple seconds; keep the hot path responsive while preserving behavior
> + * for other stats types.
> + */
> + if (param->stats_id & WMI_REQUEST_VDEV_STAT)
> + done_timeout = msecs_to_jiffies(200);
> +
> + /* Non-vdev/bcn stats are handled in a single event. */
> + if (!(param->stats_id & (WMI_REQUEST_VDEV_STAT | WMI_REQUEST_BCN_STAT)))
> + return 0;
> +
> /* Firmware sends WMI_UPDATE_STATS_EVENTID back-to-back
> * when stats data buffer limit is reached. fw_stats_complete
> * is completed once host receives first event from firmware, but
> * still there could be more events following. Below is to wait
> * until firmware completes sending all the events.
> */
> - time_left = wait_for_completion_timeout(&ar->fw_stats_done, 3 * HZ);
> + time_left = wait_for_completion_timeout(&ar->fw_stats_done, done_timeout);
> if (!time_left) {
> - ath12k_warn(ab, "time out while waiting for fw stats done\n");
> + if (param->stats_id & WMI_REQUEST_VDEV_STAT)
> + ath12k_dbg(ab, ATH12K_DBG_WMI,
> + "time out while waiting for fw stats done (stats_id 0x%x)\n",
> + param->stats_id);
> + else
> + ath12k_warn(ab, "time out while waiting for fw stats done\n");
> return -ETIMEDOUT;
> }
>
next prev parent reply other threads:[~2026-02-26 1:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 12:17 [PATCH ath-next v2 0/4] wifi: ath12k: harden stats/rate handling for WCN785x stability m.limarencko
2026-02-12 12:17 ` [PATCH ath-next v2 1/4] wifi: ath12k: return error when survey frequency is not found m.limarencko
2026-02-12 12:17 ` [PATCH ath-next v2 2/4] wifi: ath12k: avoid long fw_stats waits on vdev stats hot path m.limarencko
2026-02-26 1:50 ` Baochen Qiang [this message]
2026-02-12 12:17 ` [PATCH ath-next v2 3/4] wifi: ath12k: sanitize invalid MCS metadata in rx path m.limarencko
2026-02-12 12:17 ` [PATCH ath-next v2 4/4] wifi: ath12k: sanitize invalid MCS metadata in monitor " m.limarencko
2026-02-25 22:24 ` [PATCH ath-next v2 0/4] wifi: ath12k: harden stats/rate handling for WCN785x stability Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34363bc5-2439-4579-8999-67dedded39d0@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=m.limarencko@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox