Skip to content

wifi: brcmfmac: quiesce TX and defer country updates across suspend - #854

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/brcmfmac-suspend-regulatory
Nov 2, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/brcmfmac-suspend-regulatory

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

brcmfmac logged three errors on every system suspend on the J616s (BCM4388) and the M1 Pro (BCM4387): "bus is down", "Country code iovar returned err = -5" and, on the M1 Pro, "xmit rejected". The regulatory notifier fired after the PCIe bus had already entered D3, and the network stack kept handing packets to a bus that was going down.

This series fixes that at the source:

  • Regulatory requests that arrive while the wiphy is suspended are cached under RTNL. The latest valid country is applied from wiphy resume, after the transport is back. Failed updates stay pending, and the initial band setup is kept until it succeeds.
  • Network TX is stopped and drained before the D3 handshake. The message-buffer TX and flowring workers are fenced with their pending work kept, and restarted only after interrupts and HOSTREADY are restored. Bus flow control has its own stop reason, so resume can't clear a disconnected or firmware flow-control stop. A failed D3 handshake restores TX and the console timer.
  • A country missing from the firmware mapping no longer makes cfg80211 shut down all interfaces on wake.

No log levels were lowered. No radio power, Bluetooth, GPIO or DART behaviour changes.

Testing

Kernel 7.3.0-aurora-j616s-sleepq (aurora-wip a7a8a25 with this series, #851 and an AFK change):

Cycles bus is down country -5 xmit rejected Wi-Fi back
J616s, RTC s2idle, ANE up 21 0 0 0 1.3 s (first 3.4 s)
M1 Pro, pm_test=platform freeze 20 0 0 0 1.3 to 25 s
M1 Pro baseline, fleet14m 20 12 12 10 1.3 to 25 s

The M1 Pro baseline also logged 2 "flowring txstatus" timeouts; the series logged none. The M1 Pro drops association on every freeze and takes about 20 s to reassociate with and without this series, so that is a separate issue. Bluetooth stayed up after every cycle on both machines, with no hci0 errors, DART faults or warnings.

Host tests: 175/175 (tools/asahi/run-host-tests.py), including the new brcmf-suspend-tests with five mutation controls. checkpatch --strict: 0 errors, 1 MAINTAINERS note for the new test file.

Task: t-4548.

🤖 Generated with Claude Code

Cache regulatory requests under RTNL while the wiphy is suspended and
replay the latest valid country from wiphy resume, after transport
resume. Keep failed updates pending and preserve the initial band
setup until it succeeds.

Stop and drain network TX before the PCIe D3 handshake, fence
message-buffer TX and flowring workers while retaining their
pending work, and restart them only after interrupts and HOSTREADY
are restored. Track bus flow control independently so resume cannot
clear disconnected or firmware flow-control stops. Restore the console
timer and TX on a failed D3 handshake.

Add production-code host controls for regulatory replay, TX stop
reasons, deferred workers, retained/cold resume and suspend rollback,
with five assertion-producing mutations.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Keep failed country updates pending with their existing firmware
diagnostics, without returning the regulatory error from the wiphy
PM callback. A country not present in the firmware mapping must not
cause cfg80211 to shut down all interfaces on wake.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 7f12698 into aurora-wip Nov 2, 2026
@RyanTheTide
RyanTheTide deleted the fix/brcmfmac-suspend-regulatory branch November 2, 2026 10:53
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…tion/aurora

Bring integration/aurora up to aurora-wip 7f12698, the source of
7.3.0-aurora-fleet14n, promoted on all four machines on 2026-11-02.
The range also covers the fleet14m source a7a8a25. It adds aurora-silicon#780,
aurora-silicon#781, aurora-silicon#848, aurora-silicon#849, aurora-silicon#850, aurora-silicon#853, aurora-silicon#851 and aurora-silicon#854. No conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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