Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Berg, Benjamin" <benjamin.berg@intel.com>
To: "johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"iacobcatalin@gmail.com" <iacobcatalin@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"pkshih@realtek.com" <pkshih@realtek.com>,
	"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [PATCH REGRESSION] wifi: mac80211: also accept RX frames reported on channel center frequency
Date: Thu, 3 Dec 2026 17:04:58 +0000	[thread overview]
Message-ID: <20fe63dbc68274d02d05c229989f0aa6a2c72b34.camel@intel.com> (raw)
In-Reply-To: <20261203-wifi-breakage-7-4-rc1-v1-1-c11ca35ceb89@gmail.com>

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.

      reply	other threads:[~2026-12-03 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20fe63dbc68274d02d05c229989f0aa6a2c72b34.camel@intel.com \
    --to=benjamin.berg@intel.com \
    --cc=iacobcatalin@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=regressions@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox