Skip to content

wifi: brcmfmac: pcie: skip pointer updates for unconfigured flowrings - #3529

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/brcmfmac-unconfigured-flowring-20261129
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/brcmfmac-unconfigured-flowring-20261129

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: brcmfmac logs a false KERN_ERR "r_ptr 0 outside depth 0" on J713, J616s and J615 for flowrings that are allocated but not configured yet. This has happened since linux#2907. Ring pointer updates now return early while a ring's depth is still zero. The bounds check, the error message and the last-good pointer for configured rings are unchanged.

Tested: Host tests only, no Mac row yet. Strict checkpatch is clean and the arm64 LLVM build of pcie.o passes. The shared-TCM host suite passes 24 controls and catches all 16 mutations, including one that removes the new guard. The ASan/UBSan harness passes 1,572,864 cases, including corruption on configured rings. The existing brcmfmac KUnit suites pass 3/3.

Risk: two-way · every Mac with brcmfmac PCIe Wi-Fi.

Not yet: J615/J713 boot with Wi-Fi traffic and a reconnect, plus a dmesg check, and a J616s regression row. These go in each Mac's next combined boot (lanes/HWROWS-QUEUE.md).

Details

Flowring descriptors are zero-initialized and get their update callbacks before brcmf_commonring_config() sets a nonzero depth. The new guard runs before either firmware index is read, and returns -EIO like the existing not-UP path. Callers in commonring.c ignore the return value.

Evidence

Fixes: 73d8f7c. Source item: SEC-SOC2 finding (lanes/SEC-SOC2.md:41).

Flowring descriptors are zero-initialized and get their callbacks before
brcmf_commonring_config() sets a nonzero depth. Updating a pointer on one
of these rings reports a false "r_ptr 0 outside depth 0" error.

Return -EIO quietly before reading either firmware index while the depth
is zero. Keep the bounds check, error message and last good pointer for
configured rings unchanged.

Extend the shared TCM host controls to check that unconfigured flowrings
neither read firmware indices nor log errors, and that out-of-range
pointers on configured rings still report errors. Add a mutation that
removes the unconfigured-ring guard.

Fixes: 73d8f7c ("wifi: brcmfmac: pcie: take ring pointers from the dongle only inside the ring")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners November 28, 2026 13:11

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 1d48270c

Blockers:

  1. Hosted CI at 1d48270c (host-tests, pr-text / pr-text, readiness / readiness) is currently QUEUED; wait for green CI.
  2. Missing exact-head hardware row on a brcmfmac PCIe Mac (J615/J713 Wi-Fi traffic + reconnect + dmesg check and J616s regression row; noted as queued in Not yet:).

Checked: no Apple material, no AI attribution, human DCO Signed-off-by, no chip/board/firmware gates, no parameters or hardcoded safety limits, full diff (+21/-2 across drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c, tools/asahi/brcmf-shared-tcm-tests.py, tools/asahi/run-host-tests.py) verified, host tests (24 controls, 16/16 mutations including unconfigured-depth, 1,572,864 ASan/UBSan cases, 3/3 KUnit) + arm64 LLVM build + checkpatch --strict clean, PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.

Evidence
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c:1506 & :1537: adds if (!commonring->depth) return -EIO; immediately after the BRCMFMAC_PCIE_STATE_UP check in both brcmf_pcie_ring_mb_update_rptr() and brcmf_pcie_ring_mb_update_wptr(), preventing spurious r_ptr 0 outside depth 0 KERN_ERR logs and firmware index reads on allocated-but-unconfigured flowrings while leaving configured-ring bounds checks and last-good pointer preservation untouched.
  • tools/asahi/brcmf-shared-tcm-tests.py & run-host-tests.py: exercises unconfigured flowrings with indices 0 and 0xffff (verifying -EIO, 0 reads, 0 error logs) and adds the unconfigured-depth mutation to the host test matrix.
  • Code is clean; ready to approve and merge once CI is green and the queued hardware rows pass at 1d48270c.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:wireless Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 1d48270c: not ready yet

Check Detail
CI at head ok 2 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 1d48270c
Conflicts ok none
PR text ok Risk: two-way · every Mac with brcmfmac PCIe Wi-Fi.

Areas: area:gpu, area:wireless

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 (M3 Air, BCM4388) at exact head 1d48270c: Wi-Fi PASS. The kernel is this head with the fleet89 config, run as one GRUB one-shot under a dead-man. Afterwards the Mac returned to its saved default and the test kernel was removed.

J713 (M4) is queued in its next window. Evidence (lab store): traces/wifi-bt/20261129-airs-pr3529/j615-head-1d48270c/.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

@aurora-silicon/core: code-owner heads-up. Once the J713 row passes (queued for its next window) and the review App approves this head, the plan is to merge 1d48270c with --merge --admin under the six-point rule: App review, green CI, J615 + J713 rows at the head across two families, no blocking review, and this notice at least 1 h earlier. Revert: git revert -m 1 <merge>.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J713 (M4 Air, BCM4388) at exact head 1d48270c: PASS. Same one-shot and rows as the J615 receipt. 100 x 1400-byte pings to the gateway with 0% loss, before and after a NetworkManager reconnect. The reconnect re-associated and had its route back within 1 s. 0 outside depth lines and 0 brcmf error lines for the boot. Production smoke row VERDICT PASS. Saved fleet85 restored and verified.

With J615 (M3) and J713 (M4), the rows cover two families at this head. In the same window this kernel was also used for an early deep sleep for #3555, and the Mac reset on suspend entry. That failure pattern reproduces on main without this PR: the first instance was on a81a12c7 without #3529. See #3555. It is not a regression from this change, and the Wi-Fi path this PR touches was clean on both Macs. Evidence (lab store): traces/wifi-bt/20261129-airs-pr3529/j713-head-1d48270c/.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 28, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 1d48270c5632

Blockers: None from this review. Keep the J616s check as follow-up coverage for the logged symptom.

Checked: Both flowring callbacks return before firmware index reads only while depth is zero. Configured rings retain the bounds error and last-good index. The host fixture checks both callback paths and detects removal of the new guard. Hosted host-tests, PR-text and readiness passed. Exact J615 and J713 reports show zero loss across reconnect, zero out-of-depth messages, and saved boot restoration.

Evidence
  • J615: #3529 (comment)
  • J713: #3529 (comment)
  • The J615 report records a GeoClue timeout before the reconnect that also occurs on the saved kernel. The Wi-Fi checks passed on both families.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging 1d48270c with --merge --admin under the six-point rule:

  1. The aurora-silicon-review App approved this head (22:30Z), as a different lane from the author's.
  2. Hosted CI is green at the head: host-tests, pr-text, readiness.
  3. Exact-head hardware rows: J615 and J713 Wi-Fi traffic plus reconnect, 0 outside depth, 0 brcmf errors.
  4. Regression across two families: J615 (M3) and J713 (M4), smoke rows, saved defaults restored.
  5. No open blocking review.
  6. Code owners were notified at 05:37 AEDT, more than an hour ago.

The J616s check remains follow-up coverage as the review suggests. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit c1525da into main Nov 28, 2026
4 of 5 checks passed
@RyanTheTide
RyanTheTide deleted the fix/brcmfmac-unconfigured-flowring-20261129 branch November 28, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:wireless Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant