* [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency
@ 2026-12-03 16:53 Catalin Iacob
2026-12-03 17:04 ` Berg, Benjamin
0 siblings, 1 reply; 3+ messages in thread
From: Catalin Iacob @ 2026-12-03 16:53 UTC (permalink / raw)
To: Johannes Berg, Benjamin Berg
Cc: Ping-Ke Shih, linux-wireless, regressions, Catalin Iacob
Commit 6d531b9af16e ("wifi: mac80211: rework RX packet handling")
intentionally made mac80211 more strict by checking the RX frame's
frequency when determining the link. However, it did not account for
drivers reporting the center frequency of the configured channel rather
than the primary channel frequency. Relax the check to also accept
configured channel center frequencies, including both centers for
80+80MHz channels.
Fixes: 6d531b9af16e ("wifi: mac80211: rework RX packet handling")
Signed-off-by: Catalin Iacob <iacobcatalin@gmail.com>
---
Since 7.4-rc1 my wireless card doesn't work at all on a 5GHz access
point, not even ping to the default gateway. This is perfectly
reproducible at every boot since rc1, I just did not get the chance to
debug and report it so far. lspci identifies the card as:
c0:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8922AE 802.11be PCIe Wireless Network Ad
From code analysis I expect more drivers could be broken the same way
though it's dependent on channel frequencies which I guess explains why
this one is rare enough that it wasn't reported yet based on what I see
in the wireless tree and on lore.
I bisected the issue to 6d531b9af16e ("wifi: mac80211: rework RX packet
handling")
I don't know the code at all but, with some LLM help, I poked around,
added some debug prints and this one added to ieee80211_rx_valid_freq
when it would return falso best shows what's happening:
pr_warn_ratelimited("wifihangdebug: mac80211: rejecting RX frame on %s: fc=%04x reported frequency %d MHz, expected primary %d MHz (channel %d), width %d MHz, center_freq1 %d MHz, center_freq2 %d MHz\n",
link->sdata->name, le16_to_cpu(hdr->frame_control),
freq, conf->def.chan->center_freq,
conf->def.chan->hw_value,
nl80211_chan_width_to_mhz(conf->def.width),
conf->def.center_freq1, conf->def.center_freq2);
prints:
wifihangdebug: mac80211: rejecting RX frame on wlp192s0: fc=4208 reported frequency 5210 MHz, expected primary 5180 MHz (channel 36), width 80 MHz, center_freq1 5210 MHz, center_freq2 0 MHz
See the patch for what appears to me as a correct fix: drivers can
report both frequencies so both need to be accepted. In my tests this
works and fixes wifi for my card. But take the code and expecially the
commit message with grains of salt, I don't know the area to trust that
it's a proper fix explained with correct terminology.
#regzbot introduced: 6d531b9af16e
---
net/mac80211/rx.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f8cfd04c0c6c..2d8c160d84b0 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -5346,6 +5346,14 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
dev_kfree_skb(skb);
}
+static bool ieee80211_rx_freq_matches_chan(int freq,
+ struct ieee80211_chanctx_conf *conf)
+{
+ return freq == conf->def.chan->center_freq ||
+ freq == conf->def.center_freq1 ||
+ (conf->def.center_freq2 && freq == conf->def.center_freq2);
+}
+
static bool ieee80211_rx_valid_freq(int freq, struct ieee80211_link_data *link)
{
struct ieee80211_chanctx_conf *conf;
@@ -5358,7 +5366,7 @@ static bool ieee80211_rx_valid_freq(int freq, struct ieee80211_link_data *link)
if (!conf || !conf->def.chan)
return false;
- return freq == conf->def.chan->center_freq;
+ return ieee80211_rx_freq_matches_chan(freq, conf);
}
static struct ieee80211_link_data *
@@ -5374,7 +5382,7 @@ ieee80211_link_from_freq(struct ieee80211_sub_if_data *sdata, int freq)
if (!conf || !conf->def.chan)
continue;
- if (freq == conf->def.chan->center_freq)
+ if (ieee80211_rx_freq_matches_chan(freq, conf))
return link;
}
---
base-commit: 2dcd468aff400f859d8e520e41814e7fd35e35aa
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main
change-id: 20261203-wifi-breakage-7-4-rc1-d46f38f9ed7f
Best regards,
--
Catalin Iacob <iacobcatalin@gmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency
2026-12-03 16:53 [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency Catalin Iacob
@ 2026-12-03 17:04 ` Berg, Benjamin
2026-12-03 21:02 ` Catalin Iacob
0 siblings, 1 reply; 3+ messages in thread
From: Berg, Benjamin @ 2026-12-03 17:04 UTC (permalink / raw)
To: johannes@sipsolutions.net, iacobcatalin@gmail.com
Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com,
regressions@lists.linux.dev
Hi,
On Thu, 2026-12-03 at 18:53 +0200, Catalin Iacob wrote:
> Commit 6d531b9af16e ("wifi: mac80211: rework RX packet handling")
> intentionally made mac80211 more strict by checking the RX frame's
> frequency when determining the link. However, it did not account for
> drivers reporting the center frequency of the configured channel
> rather
> than the primary channel frequency. Relax the check to also accept
> configured channel center frequencies, including both centers for
> 80+80MHz channels.
So, the field is documented as
* @freq: frequency the radio was tuned to when receiving this frame, in MHz
* This field must be set for management frames, but isn't strictly needed
* for data (other) frames - for those it only affects radiotap reporting.
and I always thought that this was supposed to be the control frequency
rather than the channel center frequency.
Would it be possible to change the reporting on the driver side to so
that everyone agrees on the same definition?
Benjamin
>
> Fixes: 6d531b9af16e ("wifi: mac80211: rework RX packet handling")
> Signed-off-by: Catalin Iacob <iacobcatalin@gmail.com>
> ---
> Since 7.4-rc1 my wireless card doesn't work at all on a 5GHz access
> point, not even ping to the default gateway. This is perfectly
> reproducible at every boot since rc1, I just did not get the chance
> to
> debug and report it so far. lspci identifies the card as:
>
> c0:00.0 Network controller: Realtek Semiconductor Co., Ltd.
> RTL8922AE 802.11be PCIe Wireless Network Ad
>
> From code analysis I expect more drivers could be broken the same way
> though it's dependent on channel frequencies which I guess explains
> why
> this one is rare enough that it wasn't reported yet based on what I
> see
> in the wireless tree and on lore.
>
> I bisected the issue to 6d531b9af16e ("wifi: mac80211: rework RX
> packet
> handling")
>
> I don't know the code at all but, with some LLM help, I poked around,
> added some debug prints and this one added to ieee80211_rx_valid_freq
> when it would return falso best shows what's happening:
>
> pr_warn_ratelimited("wifihangdebug: mac80211: rejecting RX frame on
> %s: fc=%04x reported frequency %d MHz, expected primary %d MHz
> (channel %d), width %d MHz, center_freq1 %d MHz, center_freq2 %d
> MHz\n",
> link->sdata->name, le16_to_cpu(hdr-
> >frame_control),
> freq, conf->def.chan->center_freq,
> conf->def.chan->hw_value,
> nl80211_chan_width_to_mhz(conf->def.width),
> conf->def.center_freq1, conf->def.center_freq2);
> prints:
>
> wifihangdebug: mac80211: rejecting RX frame on wlp192s0: fc=4208
> reported frequency 5210 MHz, expected primary 5180 MHz (channel 36),
> width 80 MHz, center_freq1 5210 MHz, center_freq2 0 MHz
>
> See the patch for what appears to me as a correct fix: drivers can
> report both frequencies so both need to be accepted. In my tests this
> works and fixes wifi for my card. But take the code and expecially
> the
> commit message with grains of salt, I don't know the area to trust
> that
> it's a proper fix explained with correct terminology.
>
> #regzbot introduced: 6d531b9af16e
> ---
> net/mac80211/rx.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index f8cfd04c0c6c..2d8c160d84b0 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -5346,6 +5346,14 @@ static void __ieee80211_rx_handle_8023(struct
> ieee80211_hw *hw,
> dev_kfree_skb(skb);
> }
>
> +static bool ieee80211_rx_freq_matches_chan(int freq,
> + struct
> ieee80211_chanctx_conf *conf)
> +{
> + return freq == conf->def.chan->center_freq ||
> + freq == conf->def.center_freq1 ||
> + (conf->def.center_freq2 && freq == conf-
> >def.center_freq2);
> +}
> +
> static bool ieee80211_rx_valid_freq(int freq, struct
> ieee80211_link_data *link)
> {
> struct ieee80211_chanctx_conf *conf;
> @@ -5358,7 +5366,7 @@ static bool ieee80211_rx_valid_freq(int freq,
> struct ieee80211_link_data *link)
> if (!conf || !conf->def.chan)
> return false;
>
> - return freq == conf->def.chan->center_freq;
> + return ieee80211_rx_freq_matches_chan(freq, conf);
> }
>
> static struct ieee80211_link_data *
> @@ -5374,7 +5382,7 @@ ieee80211_link_from_freq(struct
> ieee80211_sub_if_data *sdata, int freq)
> if (!conf || !conf->def.chan)
> continue;
>
> - if (freq == conf->def.chan->center_freq)
> + if (ieee80211_rx_freq_matches_chan(freq,
> conf))
> return link;
> }
>
>
> ---
> base-commit: 2dcd468aff400f859d8e520e41814e7fd35e35aa
> base-tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
> main
> change-id: 20261203-wifi-breakage-7-4-rc1-d46f38f9ed7f
>
> Best regards,
> --
> Catalin Iacob <iacobcatalin@gmail.com>
________________________________________
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 (89) 99143-0
www.intel.de
Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman
Chairperson of the Supervisory Board: Sonja Pierer
Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency
2026-12-03 17:04 ` Berg, Benjamin
@ 2026-12-03 21:02 ` Catalin Iacob
0 siblings, 0 replies; 3+ messages in thread
From: Catalin Iacob @ 2026-12-03 21:02 UTC (permalink / raw)
To: Berg, Benjamin
Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org,
pkshih@realtek.com, regressions@lists.linux.dev
On Thu, Dec 03, 2026 at 05:04:58PM +0000, Berg, Benjamin wrote:
> So, the field is documented as
>
> * @freq: frequency the radio was tuned to when receiving this frame, in MHz
> * This field must be set for management frames, but isn't strictly needed
> * for data (other) frames - for those it only affects radiotap reporting.
>
> and I always thought that this was supposed to be the control frequency
> rather than the channel center frequency.
>
> Would it be possible to change the reporting on the driver side to so
> that everyone agrees on the same definition?
I looked through the rtw code, it doesn't seem trivial to me because
part of it comes from hardware, e.g. phy_ppdu->chan_index in
rtw8922a_fill_freq_with_ppdu and similar code for other Realtek models
and I don't know how "normalized" what the hardware reports is. I expect
Ping-Ke Shih will answer around feasibility of doing this for Realtek.
I did not check other drivers, there could be more having similar
issues.
These reasons are why I judged my patch to be better than auditing and
changing the drivers but given my lack of expertise it's more a guess
than something I stand by. Happy with any solution you pick, just please
fix this before 7.4 final, it's a big regression for the drivers
affected.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-03 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:53 [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency Catalin Iacob
2026-12-03 17:04 ` Berg, Benjamin
2026-12-03 21:02 ` Catalin Iacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox