Re: [PATCH ath-current 5/8] wifi: ath12k: introduce host_alloc_ml_id hardware parameter
Rameshkumar Sundaram <[email protected]> Thu, 16 Jul 2026 20:25:26 +0530
| Newsgroups | org.infradead.lists.ath12k,org.kernel.vger.linux-wireless |
|---|---|
| Message-ID | <[email protected]> |
On 7/13/2026 1:03 PM, Baochen Qiang wrote: > Different ath12k devices diverge on who allocates MLD peer id: > WCN7850/QCC2072 have the firmware allocate it and notify the host via > HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP event; While others let the host allocate > it and pass it down through WMI_PEER_ASSOC_CMDID with > ATH12K_WMI_FLAG_MLO_PEER_ID_VALID set. > > Currently ath12k host allocates this ID and sends it to firmware by > default for all devices. This breaks WCN7850/QCC2072, because the host > maintained ID may be different from the firmware-allocated one. > Consequently data path may fail to find the dp peer and drop some received > packets. From user point of view, this results in bugs reported in [1] or > the 4-way handshake timeout issue. > > Add host_alloc_ml_id flag to struct ath12k_hw_params (and a copy on struct > ath12k_hw for hot-path access) so subsequent patches can branch on it. Set > true for QCN9274/IPQ5332/IPQ5424, false for WCN7850/QCC2072. The flag will > be consumed by subsequent patches. > > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=221039 # 1 > Signed-off-by: Baochen Qiang <[email protected]> > --- > drivers/net/wireless/ath/ath12k/core.h | 1 + > drivers/net/wireless/ath/ath12k/hw.h | 2 ++ > drivers/net/wireless/ath/ath12k/mac.c | 17 ++++++++++++++++- > drivers/net/wireless/ath/ath12k/wifi7/hw.c | 12 ++++++++++++ > 4 files changed, 31 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h > index fc5127b5c1a3..1f56474efbea 100644 > --- a/drivers/net/wireless/ath/ath12k/core.h > +++ b/drivers/net/wireless/ath/ath12k/core.h > @@ -793,6 +793,7 @@ struct ath12k_hw { > enum ath12k_hw_state state; > bool regd_updated; > bool use_6ghz_regd; > + bool host_alloc_ml_id; > > u8 num_radio; > > diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h > index d135b2936378..8091501cf742 100644 > --- a/drivers/net/wireless/ath/ath12k/hw.h > +++ b/drivers/net/wireless/ath/ath12k/hw.h > @@ -232,6 +232,8 @@ struct ath12k_hw_params { > u32 max_client_dbs; > u32 max_client_dbs_sbs; > } client; > + > + bool host_alloc_ml_id; > }; > > struct ath12k_hw_ops { > diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c > index 7d0d7d5fbf53..9e5fcbf8c730 100644 > --- a/drivers/net/wireless/ath/ath12k/mac.c > +++ b/drivers/net/wireless/ath/ath12k/mac.c > @@ -15382,8 +15382,9 @@ int ath12k_mac_allocate(struct ath12k_hw_group *ag) > int mac_id, device_id, total_radio, num_hw; > struct ath12k_base *ab; > struct ath12k_hw *ah; > - int ret, i, j; > + bool conf = false; > u8 radio_per_hw; > + int ret, i, j; > > total_radio = 0; > for (i = 0; i < ag->num_devices; i++) { > @@ -15423,6 +15424,19 @@ int ath12k_mac_allocate(struct ath12k_hw_group *ag) > } > > ab = ag->ab[device_id]; > + > + /* > + * the assumption is all devices within an ah > + * share the same host_alloc_ml_id configuration > + */ > + if (j == 0) { > + conf = ab->hw_params->host_alloc_ml_id; > + } else if (conf != ab->hw_params->host_alloc_ml_id) { > + ath12k_warn(ab, "inconsistent ML ID config within ah, device 0 uses %s allocated ID, while device %u doesn't\n", > + conf ? "host" : "firmware", device_id); a garbage ret will be returned in this err path. > + goto err; > + } > + > pdev_map[j].ab = ab; > pdev_map[j].pdev_idx = mac_id; > mac_id++; > @@ -15447,6 +15461,7 @@ int ath12k_mac_allocate(struct ath12k_hw_group *ag) > } > > ah->dev = ab->dev; > + ah->host_alloc_ml_id = conf; > > ag->ah[i] = ah; > ag->num_hw++; -- Ramesh