diff mbox series

[ath-next] wifi: ath12k: limit WMI_SCAN_CHAN_LIST_CMDID argument size

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

Commit Message

Mantas Pucka March 10, 2025, 1:28 p.m. UTC
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,

Comments

Vasanthakumar Thiagarajan March 13, 2025, 9:45 a.m. UTC | #1
On 3/10/2025 6:58 PM, Mantas Pucka wrote:
> 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

Did you have any private changes to increase the message_len from current
2048 ot 4096 bytes? As mentioned in a reply for your other patch, multi-band
in qcn9274 requires additional changes in driver, only scan mode is supported
even with those changes.

Vasanth
Vasanthakumar Thiagarajan March 13, 2025, 11:14 a.m. UTC | #2
On 3/13/2025 3:40 PM, Mantas wrote:
> On 2025-03-13 11:45, Vasanthakumar Thiagarajan wrote:
>>
>>
>> On 3/10/2025 6:58 PM, Mantas Pucka wrote:
>>> 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
>>
>> Did you have any private changes to increase the message_len from current
>> 2048 ot 4096 bytes? As mentioned in a reply for your other patch, multi-band
>> in qcn9274 requires additional changes in driver, only scan mode is supported
>> even with those changes.
>>
> No private changes, using unmodified FW from:
> 
> https://git.codelinaro.org/clo/ath-firmware/ath12k-firmware/-/tree/main/QCN9274/hw2.0/1.4.1/WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
> 
> max_msg_len comes from FW initialization message:
> 
> ath12k_htc_connect_service max_msg_len=0 flags_len=0x0 assigned_eid=0
> boot htc service 'Control' ul pipe 0 dl pipe 1 eid 0 ready
> ath12k_htc_connect_service max_msg_len=2040 flags_len=0x7f80100 assigned_eid=1
> boot htc service 'HTT Data' ul pipe 4 dl pipe 1 eid 1 ready
> ath12k_htc_connect_service max_msg_len=4088 flags_len=0xff80200 assigned_eid=2
> boot htc service 'WMI' ul pipe 3 dl pipe 2 eid 2 ready
> 

Ah, I see. It looks like firmware does not strictly honor the host configuration
in some cases.

> 
> Is support for multi-band AP/STA limited by FW? AFAIK it works with proprietary driver.
> 

There are no validations done with multi-band AP/STA mode configurations.
So we can not really claim the support.

Vasanth
diff mbox series

Patch

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;