]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: add offchannel check to mt76_roc_complete
authorFelix Fietkau <nbd@nbd.name>
Mon, 9 Mar 2026 06:07:22 +0000 (06:07 +0000)
committerFelix Fietkau <nbd@nbd.name>
Tue, 24 Mar 2026 15:49:31 +0000 (15:49 +0000)
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.

Link: https://patch.msgid.link/20260309060730.87840-3-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/channel.c

index d9f8529db7ed41554e054b85f8eb17e635fbadb4..ae7b4ed27a5c8579655c3a19e224223f963b0065 100644 (file)
@@ -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);