]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: mt76: mt7921: fix a potential scan no APs
authorQuan Zhou <quan.zhou@mediatek.com>
Thu, 18 Jul 2024 13:49:09 +0000 (21:49 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 13 Jan 2025 10:21:54 +0000 (11:21 +0100)
In multi-channel scenarios, the granted channel must be aborted before
station remove. Otherwise, the firmware will be put into a wrong state,
resulting in have chance to make subsequence scan no APs.
With this patch, the granted channel will be always aborted before
station remove.

Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Tested-by: David Ruth <druth@chromium.org>
Reviewed-by: David Ruth <druth@chromium.org>
Link: https://patch.msgid.link/1ac1ae779db86d4012199a24ea2ca74050ed4af6.1721300411.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/main.c

index a7f5bfbc02ed1f45f6a903fb8ceff63a1c54c526..2ef8dbfc4a95ac9877508c44d5c9c279ecced9fb 100644 (file)
@@ -360,9 +360,9 @@ void mt7921_roc_abort_sync(struct mt792x_dev *dev)
        del_timer_sync(&phy->roc_timer);
        cancel_work_sync(&phy->roc_work);
        if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
-               ieee80211_iterate_active_interfaces(mt76_hw(dev),
-                                                   IEEE80211_IFACE_ITER_RESUME_ALL,
-                                                   mt7921_roc_iter, (void *)phy);
+               ieee80211_iterate_interfaces(mt76_hw(dev),
+                                            IEEE80211_IFACE_ITER_RESUME_ALL,
+                                            mt7921_roc_iter, (void *)phy);
 }
 EXPORT_SYMBOL_GPL(mt7921_roc_abort_sync);
 
@@ -858,6 +858,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
        struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
 
+       mt7921_roc_abort_sync(dev);
        mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->deflink.wcid);
        mt76_connac_pm_wake(&dev->mphy, &dev->pm);