From: Ho Jie Feng <hjf3108@gmail.com>
To: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Ho Jie Feng <hjf3108@gmail.com>, linux-wireless@vger.kernel.org
Subject: [PATCH rt2x00 v2] wifi: rt2x00: upload beacon before starting the beacon queue
Date: Wed, 25 Nov 2026 23:05:53 +0800 [thread overview]
Message-ID: <20261125150553.3442483-1-hjf3108@gmail.com> (raw)
On PCI and SoC devices, rt2x00mac_bss_info_changed() starts the beacon
queue without uploading a beacon, and leaves that to the PRE_TBTT
interrupt. But the TSF is 0 when the queue starts, so the first TBTT is
due at once. With no beacon enabled, BCN_OFFSET0 is 0, and rt2800 sends
a beacon from shared memory 0x4000, the start of the pairwise key table.
On the RT3883 this wedges the baseband until the BBP is reset: the radio
neither receives nor transmits, so the AP never comes up.
Upload the beacon of the first beaconing interface before starting the
queue, as is done on USB devices. The (PRE)TBTT tasklets are not running
yet, so this cannot race with them.
Tested on an ASUS RT-N56U (RT3883).
Fixes: 1dae8d342e84 ("rt2x00: Limit beacon updates in bss_info_changed to USB devices")
Fixes: ba08910e04e0 ("rt2x00: change beaconing setup on RT2800")
Signed-off-by: Ho Jie Feng <hjf3108@gmail.com>
---
Changelog from v1:
- Add comment about how (PRE)TBTT tasklet will not race with this
https://lore.kernel.org/linux-wireless/20261122163416.14269-1-hjf3108@gmail.com/
OpenWrt PR: https://github.com/openwrt/openwrt/pull/26850
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
index 3bc0c1c906..d4e4bbfc30 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
@@ -630,10 +630,14 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
rt2x00dev->intf_beaconing++;
intf->enable_beacon = true;
/*
- * Upload beacon to the H/W. This is only required on
- * USB devices. PCI devices fetch beacons periodically.
+ * Upload beacon to the H/W. This is required on USB
+ * devices. PCI devices fetch beacons periodically, but
+ * the first TBTT can come before the first fetch. This
+ * does not race with the (PRE)TBTT tasklet, which only
+ * runs while the beacon queue is started.
*/
- if (rt2x00_is_usb(rt2x00dev))
+ if (rt2x00_is_usb(rt2x00dev) ||
+ rt2x00dev->intf_beaconing == 1)
rt2x00queue_update_beacon(rt2x00dev, vif);
if (rt2x00dev->intf_beaconing == 1) {
--
2.53.0
reply other threads:[~2026-11-25 15:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261125150553.3442483-1-hjf3108@gmail.com \
--to=hjf3108@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=stf_xl@wp.pl \
/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