| From 5a2fff9aab2204158fffcaf578afd21f85bd7c5c Mon Sep 17 00:00:00 2001 |
| From: Quan Zhou <quan.zhou@mediatek.com> |
| Date: Thu, 18 Jul 2024 21:49:09 +0800 |
| Subject: [PATCH] BACKPORT: FROMLIST: wifi: mt76: mt7921: fix a potential scan |
| no APs |
| |
| 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> |
| (am from https://patchwork.kernel.org/patch/13736564/) |
| (also found at https://lore.kernel.org/r/1ac1ae779db86d4012199a24ea2ca74050ed4af6.1721300411.git.quan.zhou@mediatek.com) |
| |
| Conflicts: |
| drivers/net/wireless/mediatek/mt76/mt7921/main.c |
| |
| BUG=b:352477466 |
| UPSTREAM-TASK=b:354848878 |
| TEST=fix a potential scan no APs |
| |
| Change-Id: Icf91599a6998861ff5cac998b3b2d4a10fd938ec |
| Signed-off-by: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com> |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5733634 |
| Reviewed-by: David Ruth <druth@chromium.org> |
| Reviewed-by: Brian Norris <briannorris@chromium.org> |
| Commit-Queue: David Ruth <druth@chromium.org> |
| (cherry picked from commit e0759d3900ed058e9859db5aa5ba95bed1cb31a6) |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5754885 |
| Tested-by: Quan Zhou <quan.zhou@mediatek.corp-partner.google.com> |
| Reviewed-by: Quan Zhou <quan.zhou@mediatek.corp-partner.google.com> |
| --- |
| drivers/net/wireless/mediatek/mt76/mt7921/main.c | 7 ++++--- |
| 1 file changed, 4 insertions(+), 3 deletions(-) |
| |
| diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c |
| index 23b228804289be7e962704b7754de5d3155cf732..a59bc6761077807f87ece16c819045a9fa3a172d 100644 |
| --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c |
| +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c |
| @@ -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); |
| |
| @@ -862,6 +862,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); |
| |
| -- |
| 2.46.0.792.g87dc391469-goog |
| |