mt7996_mac_full_reset() and the L1 SER branch of mt7996_mac_reset_work() abort a running scan and remain on channel. mt76_scan_complete() and mt76_roc_complete() then skip ieee80211_scan_completed() and ieee80211_remain_on_channel_expired() while MT76_MCU_RESET is set. mac80211 clears a hardware scan only from the completion. After an L1 SER recovery, which does not restart the hardware, every later scan on the wiphy is then refused, and a remain on channel stays pending until userspace cancels it. After a full reset, ieee80211_restart_work() warns: WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), "%s called with hardware scan in progress\n", __func__); Report an aborted scan to mac80211 in a reset as well, and an aborted remain on channel unless a hardware restart follows. On a restart, ieee80211_reconfig_roc() restarts a remain on channel that had not begun and ends one that had. Since the scan is reported as aborted, mac80211 does not continue it on the next band during the reset. Fixes: b36d55610215 ("wifi: mt76: abort scan/roc on hw restart") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/channel.c | 2 +- drivers/net/wireless/mediatek/mt76/scan.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/channel.c b/drivers/net/wireless/mediatek/mt76/channel.c index ce1824da7563..243d252e7644 100644 --- a/drivers/net/wireless/mediatek/mt76/channel.c +++ b/drivers/net/wireless/mediatek/mt76/channel.c @@ -336,7 +336,7 @@ void mt76_roc_complete(struct mt76_phy *phy) mt76_put_vif_phy_link(phy, phy->roc_vif, phy->roc_link); phy->roc_vif = NULL; phy->roc_link = NULL; - if (!test_bit(MT76_MCU_RESET, &dev->phy.state)) + if (!test_bit(MT76_RESTART, &dev->phy.state)) ieee80211_remain_on_channel_expired(phy->hw); } diff --git a/drivers/net/wireless/mediatek/mt76/scan.c b/drivers/net/wireless/mediatek/mt76/scan.c index 7bf9b7d4a8d7..4a5cdb4efc61 100644 --- a/drivers/net/wireless/mediatek/mt76/scan.c +++ b/drivers/net/wireless/mediatek/mt76/scan.c @@ -39,8 +39,7 @@ static void mt76_scan_complete(struct mt76_dev *dev, bool abort) } mt76_put_vif_phy_link(phy, dev->scan.vif, dev->scan.mlink); memset(&dev->scan, 0, sizeof(dev->scan)); - if (!test_bit(MT76_MCU_RESET, &dev->phy.state)) - ieee80211_scan_completed(phy->hw, &info); + ieee80211_scan_completed(phy->hw, &info); } void mt76_abort_scan(struct mt76_dev *dev) -- 2.47.3