mt76_change_chanctx() sets the channel of the chanctx again while a scan can still run on the phy. During the dwell on an offchannel scan channel, the phy thus returns to the operating channel without the mt76_offchannel_notify() that ends the power save period towards the AP. Abort the scan before the channel is set again, like mt76_add_chanctx() and mt76_remove_chanctx() do. Fixes: 82334623af0c ("wifi: mt76: add chanctx functions for multi-channel phy support") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/channel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/channel.c b/drivers/net/wireless/mediatek/mt76/channel.c index 192276cf19fd..115117a19b5c 100644 --- a/drivers/net/wireless/mediatek/mt76/channel.c +++ b/drivers/net/wireless/mediatek/mt76/channel.c @@ -88,6 +88,9 @@ void mt76_change_chanctx(struct ieee80211_hw *hw, IEEE80211_CHANCTX_CHANGE_RADAR))) return; + if (mt76_phy_scanning(phy)) + mt76_abort_scan(dev); + if (phy->roc_vif) mt76_abort_roc(phy); -- 2.47.3