From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385097; b=A81LSAikMWtfktWbN8BoF1Rx9hk17k+aThg1WQef4bOE2DGEDvuI+w5H1yykf6jfi7BH rYcOtLeiDLmUlIxiOVGFi0+2xd5C577ysr4fU164Xak0n+rHx34/2BZbGDQLfogHjdzli FVPjBE5TXkOiEM6j0rpC2CnOH6Bnwf65TJ3nC7l7QRVs5wld/yy/nXFWdNvD+FGA0DExp xEwBnk9yuxnRywpKfTWc5ZVZ1T5EUwFxHjmbpEuczpCdHQhZsIneAAEUVY7B05OQGdywX aCTjpzrWPPHKqDoWThSsmYmLgWVFaMATKAPjvo3ZVgedl1h/qPkOE0DfVimQjo7EMJA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385097; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Plo+jRdWbYsYv6oQjdgpsiYXXuys68MgNdk+xj6ZsHE=; b=vRyuwYQQe2ubSBaykQRQabmERfKDAcmVFZGrltnf7m3CDqiNjV+L57NbrQyOm+or8c9L 0bNzU61JvSRTYd2xLwrkw9VMhz4f/DHKbsjczfeWBpJViUti0Z1I8Iy438Yc6bD4Bk4Jr npbCZUMzkS74OUC7dsv8FjyG3f5svNaYsa6WubQMjigee4Q8jrB2jzDu4fOMAkT34Zl2k b6WlRiO89a3bJu8ju6nk+NPETqFvilZ7GvtcwbQtY59VZ1DXNmUWFRZzXlxkpxXmIqsQz KUpocLUpGTM98gLJGZnfVzK7PS1VqxkUq77UExGQgJxjOQEAt+gKJE4f1UOvYs49CWw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ys10IDAq; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A182606A32C; Fri, 4 Dec 2026 11:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ys10IDAq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1403F1F00935; Fri, 4 Dec 2026 11:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385096; bh=Plo+jRdWbYsYv6oQjdgpsiYXXuys68MgNdk+xj6ZsHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ys10IDAq24N2li9Og2ni2MBOhOMmB6ESj6KfcwZli1vm4ulCzF8reA7AptJS2Y0f0 qey2HMo3bnk79yOGVM9hA9op0OP5x6YsPVGVK2Tir9Dt5UHybKc7qSvQ8Xf1wfhQQd bYWaGj+KQq/YUcbuLNLHHrAVIw9euBuKwhr/rRdQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Devin Wittmayer , Felix Fietkau , Sasha Levin Subject: [PATCH 6.6 0376/1167] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err Date: Fri, 4 Dec 2026 18:56:43 +0900 Message-ID: <20261204100711.791741641@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Devin Wittmayer [ Upstream commit f8794eb3ff6dedbba0337c5197626b62da0ef057 ] When a monitor interface asks to see frames that failed their checksum, mac80211 passes the request down to the driver. mt7921 works out the answer, sends it to the firmware as a receive filter, and then configures the sniffer with a hardcoded byte telling it to drop those frames anyway. The answer is used once and never kept, so the sniffer never gets to see it. That matters to anyone using monitor mode to judge a link honestly, which is most of the reason to be in monitor mode at all. Mark Anthony Agarro posted the same change for mt7925: keep what mac80211 asked for on the phy, and read it back when the sniffer is configured. This does that for mt7921, and applies on top of it, since that patch is what adds the field. https://lore.kernel.org/linux-wireless/20260826091757.469953-1-markanthonyagarro@gmail.com/ The stored value is read in one place only, configuring the sniffer, which has a single caller, and that call sits inside a branch reached only by a monitor interface. Nothing else changes. Measured on an MT7922 with a read-only probe on the command as the driver sends it, so these are the driver's own bytes rather than an inference from what came back: request arm drop_err none stock 1 1 1 1 none patched 1 1 1 1 fcsfail stock 1 1 fcsfail patched 0 0 Stock sends the drop byte whether or not anyone asked for it. Patched sends it only when nobody did. Withdrawing the request and making it again inside one driver load moves the byte back and forth, 0 then 1 then 0 across three changes, so nothing sticks once set. If it does appear to stick when trying this against an MT7927, that is mac80211 rather than the driver. It raises the filter count unconditionally when a monitor comes up, but skips lowering it again for drivers that set NO_VIRTUAL_MONITOR, and that is the only chip in this family which does. Fixes: 914189af23b8 ("wifi: mt76: mt7921: fix channel switch fail in monitor mode") Signed-off-by: Devin Wittmayer Link: https://patch.msgid.link/20260826231029.39632-1-lucid_duck@justthetip.ca Signed-off-by: Felix Fietkau [ sashal: added the missing u32 rxfilter field to struct mt792x_phy, since the prerequisite mt7925 patch that introduces it is absent; the rest matches upstream. ] Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +++----- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 5 +++++ drivers/net/wireless/mediatek/mt76/mt792x.h | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index aa112371c07ce..1d44922ae59e2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -647,12 +647,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw, unsigned int *total_flags, u64 multicast) { -#define MT7921_FILTER_FCSFAIL BIT(2) -#define MT7921_FILTER_CONTROL BIT(5) -#define MT7921_FILTER_OTHER_BSS BIT(6) -#define MT7921_FILTER_ENABLE BIT(31) - struct mt792x_dev *dev = mt792x_hw_dev(hw); + struct mt792x_phy *phy = mt792x_hw_phy(hw); u32 flags = MT7921_FILTER_ENABLE; #define MT7921_FILTER(_fif, _type) do { \ @@ -664,6 +660,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw, MT7921_FILTER(FIF_CONTROL, CONTROL); MT7921_FILTER(FIF_OTHER_BSS, OTHER_BSS); + phy->rxfilter = flags; + mt792x_mutex_acquire(dev); mt7921_mcu_set_rxfilter(dev, flags, 0, 0); mt792x_mutex_release(dev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index f4e3c99bf729b..0c24831380060 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -1046,7 +1046,7 @@ int mt7921_mcu_config_sniffer(struct mt792x_vif *vif, .len = cpu_to_le16(sizeof(req.tlv)), .control_ch = chandef->chan->hw_value, .center_ch = ieee80211_frequency_to_channel(freq1), - .drop_err = 1, + .drop_err = !(vif->phy->rxfilter & MT7921_FILTER_FCSFAIL), }, }; if (chandef->chan->band < ARRAY_SIZE(ch_band)) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h index bb54832358f56..c2aecb08669ab 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h @@ -7,6 +7,11 @@ #include "../mt792x.h" #include "regs.h" +#define MT7921_FILTER_FCSFAIL BIT(2) +#define MT7921_FILTER_CONTROL BIT(5) +#define MT7921_FILTER_OTHER_BSS BIT(6) +#define MT7921_FILTER_ENABLE BIT(31) + #define MT7921_MAX_AID 20 #define MT7921_TX_RING_SIZE 2048 diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h index 6c347495e1185..47761acaf3c40 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x.h +++ b/drivers/net/wireless/mediatek/mt76/mt792x.h @@ -106,6 +106,7 @@ struct mt792x_phy { s16 coverage_class; u8 slottime; + u32 rxfilter; u32 rx_ampdu_ts; u32 ampdu_ref; -- 2.53.0