Skip to contentSkip to conversation

wifi: rt2x00: upload beacon before starting the beacon queue

PATCH New Ho Jie Feng 1 participant 1 message Nov 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rt2x00: upload beacon before starting the beacon queue

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")

---
OpenWrt PR: https://github.com/openwrt/openwrt/pull/26850

 drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +5 -3
index 3bc0c1c906..48c875e198 100644
@@ -630,10 +630,12 @@ 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.
 			 */
-			if (rt2x00_is_usb(rt2x00dev))
+			if (rt2x00_is_usb(rt2x00dev) ||
+			    rt2x00dev->intf_beaconing == 1)
 				rt2x00queue_update_beacon(rt2x00dev, vif);
 
 			if (rt2x00dev->intf_beaconing == 1) {

base-commit: e1dd8486807c1acf9551250b7f81e116a21e6ad6

Signature · 1 line
2.53.0