mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 05:16:57 +00:00
wifi: mt76: mt7996: clear stale link state on full reset
After a full chip reset, mac80211 reconfig replays interface, link and
channel context setup. mt7996_vif_link_add() short-circuits when the
link_id is still marked in mvif->valid_links, a state introduced for
postponing link teardown to interface removal. The reset path frees the
link structures without clearing those bits, so the replayed setup never
re-creates dev_info/bss_info/STA records in the restarted firmware and
never re-registers the link wcid, leaving the device inoperative.
The reset path also leaks every allocated MLD index: per-link indices
and the per-vif group/remap indices are re-allocated from scratch during
reconfig, but the old bits stay set in the masks, so repeated full
resets exhaust the index space.
Clear valid_links in the reset vif iterator and reset the MLD index
masks alongside the existing omac_mask clearing.
Fixes: ace5d3b6b49e ("wifi: mt76: mt7996: improve hardware restart reliability")
Fixes: 08813703ac41 ("wifi: mt76: mt7996: Destroy vif active links in mt7996_remove_interface()")
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -2454,6 +2454,7 @@ mt7996_mac_reset_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
|
||||
rcu_assign_pointer(mvif->link[i], NULL);
|
||||
kfree_rcu(mlink, rcu_head);
|
||||
}
|
||||
mvif->valid_links = 0;
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
@@ -2488,6 +2489,8 @@ mt7996_mac_full_reset(struct mt7996_dev *dev)
|
||||
|
||||
mt7996_for_each_phy(dev, phy)
|
||||
phy->omac_mask = 0;
|
||||
dev->mld_idx_mask = 0;
|
||||
dev->mld_remap_idx_mask = 0;
|
||||
|
||||
ieee80211_iterate_stations_atomic(hw, mt7996_mac_reset_sta_iter, dev);
|
||||
mt76_reset_device(&dev->mt76);
|
||||
|
||||
Reference in New Issue
Block a user