Repository navigation
wifi: brcmfmac: pcie: skip pointer updates for unconfigured flowrings - #3529
Conversation
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>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 1d48270c
Blockers:
- Hosted CI at
1d48270c(host-tests,pr-text / pr-text,readiness / readiness) is currentlyQUEUED; wait for green CI. - 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: addsif (!commonring->depth) return -EIO;immediately after theBRCMFMAC_PCIE_STATE_UPcheck in bothbrcmf_pcie_ring_mb_update_rptr()andbrcmf_pcie_ring_mb_update_wptr(), preventing spuriousr_ptr 0 outside depth 0KERN_ERRlogs 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 indices0and0xffff(verifying-EIO, 0 reads, 0 error logs) and adds theunconfigured-depthmutation 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.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J615 (M3 Air, BCM4388) at exact head
J713 (M4) is queued in its next window. Evidence (lab store): |
|
@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 |
|
J713 (M4 Air, BCM4388) at exact head 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 |
There was a problem hiding this comment.
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.
|
Merging
The J616s check remains follow-up coverage as the review suggests. Revert: |
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).