Repository navigation
wifi: brcmfmac: msgbuf: keep the flowring tx count from going negative - #1081
Merged
Merged
Conversation
Every Wi-Fi disconnect before system sleep logged "brcmf_msgbuf_delete_flowring: timed out waiting for txstatus", one or two per sleep cycle on BCM4387 Macs (M1 Pro, M2). A kprobe on brcmf_msgbuf_delete_flowring() reading each flowring's outstanding_tx showed two cases, 10 timeouts in 12 sleep cycles: - the count is positive: frames were queued to the AP when the link went down, and the firmware completes them only when it flushes the ring for the delete request, so the wait before that request cannot succeed; - the count is negative: after a timeout the count is set to zero, the late completions then take it below zero, and nothing resets it when the flowid is used again, so the next delete on that flowid waits out its full timeout as well. Reset the count when a ring is created, never decrement it below zero, and report the timeout at debug level with the count: it is expected when the peer is gone, and the ring is deleted either way. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
RyanTheTide
added a commit
that referenced
this pull request
Nov 7, 2026
Brings aurora-wip up to the tested release branch: CTXR execmem (#985, #1079), KFIX speaker sleep and resume fixes (#1077, #1080), JPEG v2 (#1072), Jonathan's G17 and USB work (#1073-#1076), brcmfmac flowring count (#1081), ANE H16 startup restart (#1066) and the Touch ID per-prompt match (#904). Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Wi-Fi disconnect before system sleep logs
brcmf_msgbuf_delete_flowring: timed out waiting for txstatuson the BCM4387 Macs (M1 Pro, M2): 10 lines in 12 sleep cycles on the M2 with fleet20, 2 to 14 per boot on the M1 Pro. The BCM4388 in the M4 Pro is not affected (0 in 14 deletes).Cause: a kprobe on
brcmf_msgbuf_delete_flowring()that reads every flowring'soutstanding_txshows two cases, and every timeout matches one of them:Change:
atomic_dec_if_positive()on tx completion.brcmf_dbg(MSGBUF)and the count, since it is expected when the peer is gone. The ring is deleted either way, as before.Testing: M2 (J413, BCM4387) on fleet20 (integration 98f6184), patched module swapped in live, then 6 systemd suspends and 6 direct
/sys/power/statefreezes with speakerguardd-v2 active:The speaker gate was unchanged: every cycle regranted, with 0 faults, EPERM or AVC. The module also builds with W=1 and no msgbuf warnings, and checkpatch is clean.
Not covered: the separate firmware wedge on the M1 Pro (
brcmf_msgbuf_query_dcmd_len: Timeout on response, seen once in about 84 pm_test cycles on fleet18) is not reproduced and is not addressed here.🤖 Generated with Claude Code