[PATCH ath-next] wifi: ath11k: limit number of channels per WMI command

From: Christopher Griffin via B4 Relay

Date: Sun Nov 29 2026 - 23:53:36 EST


From: Christopher Griffin <christophergriffin05@xxxxxxxxx>

ath11k_wmi_send_scan_chan_list_cmd() splits the channel list over as
many WMI_SCAN_CHAN_LIST_CMDID commands as it takes, and sizes them from
the maximum message length the firmware reports for the WMI service at
HTC connect. The host sets up the WMI command pipe with 2048-byte
buffers (CE3 in ath11k_host_ce_config_qcn9074 and in the target CE
configuration), but QCN9074 firmware can report more than that, and a
long list then goes out as one command.

The list of a single-band radio is short enough for one 2048-byte
command anyway. A QCN9074 radio whose board data enables 2.4, 5 and
6 GHz at once has 99 channels in the US, and with the radio's vendor
WLAN.HK.2.9 build the whole list goes out as one command of 2792 bytes:

ath11k_pci 0000:01:00.0: wmi no.of chan = 99 len = 2792 pdev_id = 1 num_sends = 0

After that the firmware answers no WMI command again, and nothing can
be started on the radio. With WLAN.HK.2.7.0.1-01744:

ath11k_pci 0000:01:00.0: failed to start hw scan: -110
ath11k_pci 0000:01:00.0: failed to request fw pdev stats: -110
ath11k_pci 0000:01:00.0: Timeout in receiving vdev delete response
ath11k_pci 0000:01:00.0: failed to delete vdev 0: -110

The firmware does not crash and MHI stays in mission mode.
WLAN.HK.2.9.0.1-02146 fails the same way; WLAN.HK.2.5.0.1-01208 runs
the same radio.

The firmware interface allows 58 channels in one command
(WMI_MAX_NUM_CHAN_PER_WMI_CMD in fw-api), and ath12k has had that limit
since commit d518b2d601ac ("wifi: ath12k: limit number of channels per
WMI command"), for the same kind of hang. Add it to ath11k. The list
above is then sent as 58 + 41 channels, and on WLAN.HK.2.9.0.1 the
radio scans all three bands and runs a monitor interface.

The change, this message and the test were written with Claude, an AI
coding assistant.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.9.0.1-02175-QCAHKSWPL_SILICONZ-2

Fixes: bff621fd113f ("ath11k: Send multiple scan_chan_list messages if required")
Signed-off-by: Christopher Griffin <christophergriffin05@xxxxxxxxx>
---
Found on an Arista C-460 (IPQ9574) running OpenWrt: its QCN9074 scan
radio, which has 2.4, 5 and 6 GHz in its board data, went silent at
its first interface start on WLAN.HK.2.7.0.1-01744 and
WLAN.HK.2.9.0.1-02146, and worked on WLAN.HK.2.5.0.1-01208.

Tested on that board with Linux 6.18 and ath11k from backports 7.2,
carrying the same change, on WLAN.HK.2.9.0.1-02175 as published in
networks on all three bands, and a monitor interface received on 2437,
5180 and 6135 MHz. The function is the same in ath-next. On ath-next
the patch is compile-tested only.

linux-firmware: the list went out as 58 + 41 channels, scans found
---
drivers/net/wireless/ath/ath11k/wmi.c | 6 ++----
drivers/net/wireless/ath/ath11k/wmi.h | 3 +++
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 82f85df481cbf..543e6b682c043 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -2584,10 +2584,8 @@ int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar,
max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) /
sizeof(*chan_info);

- if (chan_list->nallchans > max_chan_limit)
- num_send_chans = max_chan_limit;
- else
- num_send_chans = chan_list->nallchans;
+ num_send_chans = min3(chan_list->nallchans, max_chan_limit,
+ ATH11K_WMI_MAX_NUM_CHAN_PER_CMD);

chan_list->nallchans -= num_send_chans;
len += sizeof(*chan_info) * num_send_chans;
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index b2dade0516ac7..b4bdd0cdee610 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -66,6 +66,9 @@ struct wmi_tlv {

#define WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG 1

+/* each WMI cmd can hold 58 channel entries at most */
+#define ATH11K_WMI_MAX_NUM_CHAN_PER_CMD 58
+
#define MAX_WMI_UTF_LEN 252
#define WMI_BA_MODE_BUFFER_SIZE_256 3
/*

---
base-commit: 18d0bedbb5f0538396cb7f763ed9cd1dd69c5b23
change-id: 20261129-b4-ath11k-scan-chan-list-limit-348b8eea3846

Best regards,
--
Christopher Griffin <christophergriffin05@xxxxxxxxx>