From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12A8634E743 for ; Mon, 9 Mar 2026 06:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773036465; cv=none; b=X1tBKdDfLW81fof3DYLErqC5eAULRps5Q3eu0oMiThNFErR6YWhEzoa47DK/W2c82olk3dapK9Q0uLSK9cOizFMRSyZ1vJogXtptFDkk/PaOCERATP8nFaOgUBrSsH7tcwnlph1ZvB8oG+VJWSN9toZCk2qmlcArSXDAIfmH/N0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773036465; c=relaxed/simple; bh=31xGhr1DyEkBVorOuDisDcDYHQcwwbgvqRooWJmhYaM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=anWoMxr7XGugJr/8bB+UD8uJaPMjvPNG0Rz9bORKZM305TmYHGuaPyvc6G/U4tf0FaBpuCRE1zwU/tcj+gxUp0yEvxn34T4hECNrw4QpwU2e+CtFvlcVcfThe3tqV/GP0h0AC1YKsn1JzFQc3dJ0huCJ36MhmUKwFrpv1f/SbVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=pass smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=GUB9XFD7; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nbd.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="GUB9XFD7" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WJKLSxDJZDAQNHnpehnBcFzwqYmRpQ07f0+qPJag/Wc=; b=GUB9XFD7fjzBmbFJWU4XpoVkmt 9yz7x4KkZWZVHi/38DKnzdMoAJ+5Ya6R0t59GTDTAMEYhuF06Ix7IhNxTA8P6FJRCKKIvn44dxNgS rYpqos+wkyzRg2IsUGh6gE0aqPR10ZoOQJdOzD5/PztmS2P7B3ljlQQjQTukUAvLKb/g=; Received: from p200300cadf236500000000000000085c.dip0.t-ipconnect.de ([2003:ca:df23:6500::85c] helo=max) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vzTmB-00GH43-2d for linux-wireless@vger.kernel.org; Mon, 09 Mar 2026 07:07:35 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH mt76 03/11] wifi: mt76: add offchannel check to mt76_roc_complete Date: Mon, 9 Mar 2026 06:07:22 +0000 Message-ID: <20260309060730.87840-3-nbd@nbd.name> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309060730.87840-1-nbd@nbd.name> References: <20260309060730.87840-1-nbd@nbd.name> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/net/wireless/mediatek/mt76/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/channel.c b/drivers/net/wireless/mediatek/mt76/channel.c index d9f8529db7ed..ae7b4ed27a5c 100644 --- a/drivers/net/wireless/mediatek/mt76/channel.c +++ b/drivers/net/wireless/mediatek/mt76/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); -- 2.51.0