Skip to content

wifi: brcmfmac: report a failed join against the BSS it asked for - #1024

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
fix/brcmfmac-failed-join-bssid
Nov 6, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
fix/brcmfmac-failed-join-bssid

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

After a suspend that disconnects Wi-Fi, the M2 and M1 Pro took 18 to 21 s to get back on the network on most resumes.

A failed join is reported to cfg80211 against profile->bssid, and that field is only set when a join succeeds. So every failure was blamed on the BSS the Mac was last connected to.

What happens on the test network: wpa_supplicant ignores the 5 GHz BSS for 10 s after our own suspend disconnect and tries the router's 2.4 GHz BSS instead. That router band-steers, so the 2.4 GHz join always times out (a pinned 2.4 GHz join fails without any suspend too). Each timeout was reported against the 5 GHz BSS, so wpa_supplicant kept pushing the working BSS further down its ignore list (10, 60, 120 s) and kept retrying the failing one until NetworkManager's 15 s link timeout reset everything. kprobes on the join path showed the join going to the 2.4 GHz BSSID while the reject named the 5 GHz one.

Now the connect handler records the BSS it asks the firmware to join, or none. A successful join still overwrites it with what the firmware reports. On a failure wpa_supplicant now ignores the BSS that was tried and goes back to 5 GHz.

Tested with fleet17 + this, one-shot boots:

  • M2, suspend straight through /sys/power/state: 4.0 s on 5 of 6 resumes and 0.4 s on the other, was 18 to 21 s
  • M1 Pro, same: 2.4 to 7.5 s, was 18.5 to 22 s on fleet16
  • with NetworkManager put to sleep first, which is what a lid close does: about 4 s before and after, no rejects
  • 0 AVCs on both, no new kernel errors

New host test brcmf-join-bssid-tests.py covers failure, success and the firmware supplicant path, with three mutations that it catches. The old code fails it. Full host suite 189/189.

The remaining ~4 s is NetworkManager rescanning after wake. Keeping the association across suspend, as macOS does, would need WoWLAN, which this firmware doesn't advertise here.

🤖 Generated with Claude Code

A failed station join is reported to cfg80211 against profile->bssid
(brcmf_bss_connect_done()).  That field is only set when the firmware
reports a successful join, so after any earlier association a failure
names the BSS the interface was last associated with, not the one it
tried.

wpa_supplicant puts the reported BSS on its ignore list.  On an M2 and
M1 Pro after s2idle resume it tried the 2.4 GHz BSS of the home AP, which
the firmware cannot join; every timeout was blamed on the 5 GHz BSS it
had just left.  wpa_supplicant ignored the working BSS for 10, then 60,
then 120 seconds while it kept retrying the failing one, until
NetworkManager gave up and restarted the connection: Wi-Fi came back
18 to 21 seconds after most resumes.

Record the BSS a join asks for when it starts, or none.  The firmware's
SET_SSID success still overwrites it with the BSS it joined.  A join that
asked for no BSS and failed names none.

Add host controls for the reported BSS on failure, success and the
firmware supplicant path, with mutations for a stale target, a zero BSSID
reported as a BSS, and a connect handler that does not record its target.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant