LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets

A problem which showed up on 13.1 between BETA3 and RC1 was that on older
chipsets the fw would crash.  While some 0x18 ADD_STA problems were seen
before, d9f59799fc was the actual trigger for this problem
(in 0x28 MAC_CONTEXT command) in a squashed merge to the releng branch.
Strangely there were no changes to assoc_to_run in that revision so other
circumstances may be the actual cause but swapping the bss_info update and
the sta_state in that function seem to make my 8265 happy while AX200 and
AX210 stay good.

Thanks to everyone who helped debug this.

Sponsored by:	The FreeBSD Foundation (partially)
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2022-06-11 12:49:40 +00:00
parent 78bc019d22
commit 013e516dc9

View File

@ -1509,23 +1509,14 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
ni = NULL;
IMPROVE("ponder some of this moved to ic_newassoc, scan_assoc_success, "
"and to lesser extend ieee80211_notify_node_join");
/* Finish assoc. */
/* Update sta_state (AUTH to ASSOC) and set aid. */
ni = ieee80211_ref_node(vap->iv_bss);
lsta = ni->ni_drv_data;
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not "
"AUTH: %#x\n", __func__, lsta, lsta->state));
sta = LSTA_TO_STA(lsta);
sta->aid = IEEE80211_NODE_AID(ni);
error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC);
if (error != 0)
goto out;
IMPROVE("wme / conf_tx [all]");
@ -1559,6 +1550,16 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed);
/* This MUST come after the bss_info_changed. */
/* Finish assoc. */
/* Update sta_state (AUTH to ASSOC) and set aid. */
KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not "
"AUTH: %#x\n", __func__, lsta, lsta->state));
sta->aid = IEEE80211_NODE_AID(ni);
error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC);
if (error != 0)
goto out;
/* - change_chanctx (if needed)
* - event_callback
*/