Message ID | 20250310-limit-wmi-chanlist-v1-1-8f0fb45459a7@8devices.com |
---|---|
State | New |
Headers | show |
Series | [ath-next] wifi: ath12k: limit WMI_SCAN_CHAN_LIST_CMDID argument size | expand |
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 6d1ea5f3a791b09044191ce86f4897b7f06f35eb..88ac800d44401a139de75e90568c8d68f3ed4f3f 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -2780,6 +2780,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(struct ath12k *ar, max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / sizeof(*chan_info); + if (max_chan_limit > WMI_MAX_NUM_CHAN_PER_WMI_CMD) + max_chan_limit = WMI_MAX_NUM_CHAN_PER_WMI_CMD; + num_send_chans = min(arg->nallchans, max_chan_limit); arg->nallchans -= num_send_chans; diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h index 1ba33e30ddd279e21a57a1db6150e1d08f4a2890..2831f7e3033c7f4a9886577f542c5026f1bada28 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -3909,6 +3909,8 @@ struct wmi_stop_scan_cmd { __le32 pdev_id; } __packed; +#define WMI_MAX_NUM_CHAN_PER_WMI_CMD 58 + struct ath12k_wmi_scan_chan_list_arg { u32 pdev_id; u16 nallchans;
When using BDF with both 5GHz and 6GHz bands enabled on QCN9274, interface fails to start. It happens because FW fails to process WMI_SCAN_CHAN_LIST_CMDID with argument size >2048, resulting in a command timeout. The current code allows splitting channel list across multiple WMI commands but uses WMI max_msg_len (4096) as chunk size, which is still too large. Fix this by limiting the number of channels sent at once, using the value specified in WMI interface description [1]. [1] https://git.codelinaro.org/clo/qsdk/platform/vendor/qcom-opensource/wlan/fw-api/-/blob/NHSS.QSDK.13.0.0.6/fw/wmi_unified.h#L6459 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Signed-off-by: Mantas Pucka <mantas@8devices.com> --- drivers/net/wireless/ath/ath12k/wmi.c | 3 +++ drivers/net/wireless/ath/ath12k/wmi.h | 2 ++ 2 files changed, 5 insertions(+) --- base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d change-id: 20250310-limit-wmi-chanlist-17cb8d27cba6 Best regards,