]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
mt76: mt7921: abort uncompleted scan by wifi reset
authorSean Wang <sean.wang@mediatek.com>
Fri, 16 Apr 2021 15:30:36 +0000 (23:30 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 Apr 2021 10:20:45 +0000 (12:20 +0200)
Scan abort should be required for the uncompleted hardware scan
interrupted by wifi reset. Otherwise, it is possible that the scan
request after wifi reset gets error code -EBUSY from mac80211 and
then blocks the reconnectting to the access point.

Fixes: 0c1ce9884607 ("mt76: mt7921: add wifi reset support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/mac.c

index 572bab82315a9203e685324eaafbf9609eda2d63..3145880df6e767c66ce39ba5da535b0f3cbba44a 100644 (file)
@@ -1413,6 +1413,14 @@ void mt7921_mac_reset_work(struct work_struct *work)
        if (i == 10)
                dev_err(dev->mt76.dev, "chip reset failed\n");
 
+       if (test_and_clear_bit(MT76_HW_SCANNING, &dev->mphy.state)) {
+               struct cfg80211_scan_info info = {
+                       .aborted = true,
+               };
+
+               ieee80211_scan_completed(dev->mphy.hw, &info);
+       }
+
        ieee80211_wake_queues(hw);
        ieee80211_iterate_active_interfaces(hw,
                                            IEEE80211_IFACE_ITER_RESUME_ALL,