Commit "mt76: fix monitor rx FCS error in DFS channel" set CH_SWITCH_NORMAL for every channel switch while a monitor interface is active, to keep CH_SWITCH_DFS away from a monitored DFS channel. The monitor check comes before the offchannel check, so a scan channel also gets CH_SWITCH_NORMAL instead of CH_SWITCH_SCAN_BYPASS_DPD, and the firmware runs the full calibration on each scan channel. On an MT7981 with a monitor on the 5 GHz phy, a scan on that phy took 10.8 to 11.0 s instead of 2.9 to 3.1 s. hostapd aborts its first scan after 10 s, so ACS never completes a scan there. Apply the monitor rule only on the operating channel. Fixes: 24e69f6bc3ca ("mt76: fix monitor rx FCS error in DFS channel") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index aab4303fef65..152b75178b27 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2156,7 +2156,8 @@ int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd) }; if (cmd == MCU_EXT_CMD(SET_RX_PATH) || - phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) + (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR && + !phy->mt76->offchannel)) req.switch_reason = CH_SWITCH_NORMAL; else if (phy->mt76->offchannel) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 45a98c586efa..d7fac69ec999 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -2838,7 +2838,8 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd) if (mt76_connac_spe_idx(phy->mt76->antenna_mask)) req.tx_path_num = fls(phy->mt76->antenna_mask); - if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) + if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR && + !phy->mt76->offchannel) req.switch_reason = CH_SWITCH_NORMAL; else if (phy->mt76->offchannel || phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 25638c68c468..792e338a6644 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -927,7 +927,8 @@ int mt7921_mcu_set_chan_info(struct mt792x_phy *phy, int cmd) req.channel_band = chandef->chan->band; if (cmd == MCU_EXT_CMD(SET_RX_PATH) || - dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR) + (dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR && + !phy->mt76->offchannel)) req.switch_reason = CH_SWITCH_NORMAL; else if (phy->mt76->offchannel) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index 8d98616acd54..eeb6d89b01d5 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -4199,7 +4199,8 @@ int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag) .channel_band = ch_band[chandef->chan->band], }; - if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) + if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR && + !phy->mt76->offchannel) req.switch_reason = CH_SWITCH_NORMAL; else if (phy->mt76->offchannel || !phy->mt76->chanctx) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; -- 2.47.3