From b7d6e434382a1a4c6615f5e5fb5664b9c1ed4886 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 7 Mar 2026 13:51:24 +0000 Subject: [PATCH] wifi: mt76: add offchannel check to mt76_roc_complete mt76_roc_complete() unconditionally calls __mt76_set_channel() to restore the operating channel. The scan equivalent mt76_scan_complete() checks phy->offchannel first, skipping the restore if the phy is already back on-channel. Without this check, ROC completion performs a redundant full hardware channel switch when something has already moved the phy back. Signed-off-by: Felix Fietkau --- channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channel.c b/channel.c index d9f8529d..ae7b4ed2 100644 --- a/channel.c +++ b/channel.c @@ -324,7 +324,7 @@ void mt76_roc_complete(struct mt76_phy *phy) if (mlink) mlink->mvif->roc_phy = NULL; - if (phy->main_chandef.chan && + if (phy->main_chandef.chan && phy->offchannel && !test_bit(MT76_MCU_RESET, &dev->phy.state)) __mt76_set_channel(phy, &phy->main_chandef, false); mt76_put_vif_phy_link(phy, phy->roc_vif, phy->roc_link);