Repository navigation
wifi: drop board checks the DMA aperture and DT node already decide - #2477
Conversation
brcmf_pcie_probe() set a 42-bit DMA mask for any BCM4388 on an apple,t8132 machine, before the chip was attached. Right after the chip attach, brcmf_pcie_set_dma_mask() already raises the streaming and coherent masks to 42 bits for BCM4388 revisions 4 and 6 whenever the attached IOMMU domain's aperture starts above 4 GiB and ends within 42 bits, which is the T8132 case (the radio's aperture starts above 1 TiB). Nothing between the two allocates DMA memory. So the machine check repeated, for one SoC, a decision the aperture already makes for every Apple BCM4388. Remove it. Other Apple machines with a BCM4388 (T6020/T6030/T6040/T8122 boards) keep their behaviour: their apertures start below 4 GiB, and the helper leaves the mask alone. Fixes: ca550d3 ("wifi: brcmfmac: use the T8132 radio DMA aperture") Suggested-by: Eryk Wieliczko <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
mt_probe() required the machine to be apple,j700 and apple,t8140, and also required the function's DT node to be pci14c3,7932 behind an apple,t8140-pcie host bridge. The DT node and host checks already decide where the radio is; the board check only blocks another board with the same radio and host. Drop it. Today only the J700 device tree has a pci14c3,7932 node, so nothing changes on any machine. Suggested-by: Chris Kearney <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
|
J700 (MacBook Neo, MT7932) row: one combined test kernel (integration b4cd7b3 + this PR + #2474 + #2370 + #2299, release config), one-shot boot, compared against the same rows on the production kernel.
|
|
The J413, J316s and J700 rows are clean. Still needed: one J713 Wi-Fi row on this head (associates, traffic, back after s2idle, no DMA-mask errors), since T8132 is the only machine where the removed check ran. |
|
J713 (MacBook Air 13", M4, T8132, BCM4388 rev 6
Results (all traffic explicitly bound to
|
| Run | Kernel / brcmfmac |
State | Assoc (5500 MHz) |
Ping gw / 1.1.1.1 (5 pkts) |
128 MiB DL (SHA-256) | 32 MiB UL (SHA-256) | DMA-mask / brcmfmac errors |
|---|---|---|---|---|---|---|---|
| PR head | 521a6bf80912 (stock in-tree) |
Cold boot | Yes (-57 dBm) |
0% loss (4.29 / 4.70 ms) |
23.16 MB/s (185.3 Mbps, exact) |
6.91 MB/s (55.3 Mbps, exact) |
0 |
| PR head | 521a6bf80912 (stock in-tree) |
After 20 s s2idle (rtc1) |
Yes (-56 dBm) |
0% loss (6.59 / 6.10 ms) |
25.98 MB/s (207.8 Mbps, exact) |
10.97 MB/s (87.8 Mbps, exact) |
0 |
| PR head | 521a6bf80912 (stock in-tree) |
After 20 s deep (rtc1, resumes 0 -> 1) |
Yes (-57 dBm) |
0% loss (5.53 / 5.98 ms) |
31.80 MB/s (254.4 Mbps, exact) |
12.08 MB/s (96.7 Mbps, exact) |
0 |
| Base A/B | 0abc2f385e54 brcmfmac.ko |
Cold boot | Yes (-60 dBm) |
0% loss (5.81 / 7.12 ms) |
34.15 MB/s (273.2 Mbps, exact) |
7.50 MB/s (60.0 Mbps, exact) |
0 |
| Base A/B | 0abc2f385e54 brcmfmac.ko |
After 20 s s2idle (rtc1) |
Yes (-58 dBm) |
0% loss (4.87 / 4.52 ms) |
38.04 MB/s (304.3 Mbps, exact) |
12.91 MB/s (103.3 Mbps, exact) |
0 |
| Base A/B | 0abc2f385e54 brcmfmac.ko |
After 20 s deep (rtc1, resumes 0 -> 1) |
Yes (-58 dBm) |
0% loss (9.61 / 4.58 ms) |
36.31 MB/s (290.5 Mbps, exact) |
12.90 MB/s (103.2 Mbps, exact) |
0 |
dmesg Wi-Fi probe excerpt (521a6bf80912 vs 0abc2f385e54 base)
PR head (521a6bf80912):
pci 0000:01:00.0: [14e4:4434] type 00 class 0x028000 PCIe Endpoint
pci 0000:01:00.0: Adding to iommu group 16
pci 0000:01:00.0: BAR 2 [mem 0xb80000000-0xb80ffffff 64bit]: assigned
pci 0000:01:00.0: BAR 0 [mem 0xb82000000-0xb8200ffff 64bit]: assigned
brcmfmac 0000:01:00.0: enabling device (0000 -> 0002)
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4388c2-pcie for chip BCM4388/6
hci_bcm4377 0000:01:00.1: Using 41-bit DMA addresses
brcmfmac 0000:01:00.0: Using 41-bit DMA addresses
brcmfmac 0000:01:00.0: using bidirectional receive DMA
brcmfmac: brcmf_c_process_txcap_blob: TxCap blob found, loading
brcmfmac: brcmf_c_process_cal_blob: Calibration blob provided by platform, loading
brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4388/6 wl0: Jul 10 2026 02:04:56 version 23.50.20.2.41.51.209 FWID 01-fa2c3dc1
brcmfmac 0000:01:00.0 wlp1s0f0: renamed from wlan0
On the 0abc2f385e54 base A/B, the probe log is identical except for the single removed line immediately before enabling device:
brcmfmac 0000:01:00.0: using 42-bit DMA addresses
Assisted-by: LLM (Google:Gemini 4 Neon)
RyanTheTide
left a comment
There was a problem hiding this comment.
The source ordering is sound for the BCM4388 revisions the aperture helper covers. Probe attaches and identifies the chip before deriving its DMA mask. The early path performs PCI/register setup; DMA ring allocation occurs later. The MediaTek path still requires the device's firmware node and the matching host controller.
The decisive Broadcom comparison is J713 or J715 with a revision-6 BCM4388 and its forced high aperture, where the removed block actually ran. Please record association and the derived streaming/coherent mask on a patched boot there. The J413 and M1 Pro s2idle rows cover the retained legacy path. A Neo association row should cover the MediaTek admission change. The proposed J616s row is a useful control for the revision helper.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at 521a6bf80912e97287a4d60bc806bce7cb0285bf:
- §1 No model gating: Pass. Actively removes two redundant machine/SoC gates (
of_machine_is_compatible("apple,t8132")inbrcmfmac/pcie.candapple,j700/apple,t8140inmt7932.c) in favor of IOMMU aperture geometry (brcmf_pcie_set_dma_mask()) and hardware DT node + host controller compatibles (pci14c3,7932behindapple,t8140-pcie). Both checks are still present onintegration/aurora(not superseded). - §2 Production-ready, no hacks: Pass. Verified in
brcmf_pcie_probe()that no DMA allocations occur between probe entry andbrcmf_pcie_set_dma_mask()(onlykzalloc_objandbrcmf_chip_attach()PCI BAR/register setup).<linux/of.h>remains in use inpcie.c(of_property_*). Default command line, no hacks. - §3 Safety: Pass. DMA mask is derived from the device's attached IOMMU domain aperture (
force_aperture,> 32-bit,<= 42-bit), andmt_probe()retains supplier/PIODMA, translated DMA domain, BAR size, and DT MAC checks. - §4 Clean-room and attribution: Pass. Both commits (
34ffc9fdc3d9,521a6bf80912) have human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:/Suggested-by:trailers only, with zero AI trailers in commits; PR body includesAssisted-by:. - §5 Evidence: Pass. All affected hardware families have passing rows:
- T8132 J713 (BCM4388 rev 6 — the removed
brcmfmacgate path): standalone run on PR head521a6bf80912+ A/B vs base0abc2f385e54across cold boot, 20 ss2idle, and 20 sdeepsleep withdma_mask_bits=42/consistent_dma_mask_bits=42, 128 MiB DL and 32 MiB UL SHA-256 verified, 0 DMA-mask/brcmfmac errors, 0 failed units, 0 new kernel errors. - T8140 J700 (MT7932 — the removed
mt7932gate path): boot + association + 30 ss2idle, 0 DMA-mask/board-check lines, 0 AVC, 0 new kernel errors. - Controls: T6040 J616s (BCM4388), T8112 J413, and T6000 J316s (BCM4387) clean across boot and 3
s2idlecycles. - Live CI:
host-testsgreen on521a6bf80912(mt7932-kunitworkflow was added after this head was pushed).
- T8132 J713 (BCM4388 rev 6 — the removed
- §6 Naming: Pass.
Note (non-blocking): the Still to run list in the PR description is stale now that the J713, J700, J616s, J413, and J316s rows have been completed. Ready to merge.
Assisted-by: LLM (Gemini 4 Neon)
Problem
brcmfmac set a 42-bit DMA mask for any BCM4388 on an
apple,t8132machine (brcmfmac/pcie.c:3112, ca550d3). Right after chip attach,brcmf_pcie_set_dma_mask()already raises the mask to 42 bits for BCM4388 revisions 4 and 6, but only when the attached IOMMU aperture starts above 4 GiB. The machine check repeated that decision for one SoC. mt7932 checkedapple,j700/apple,t8140next to the radio's own DT node (pci14c3,7932) and itsapple,t8140-pciehost.Change
Testing
Built with the lane release config (arm64, LLVM=1): W=1 on brcmfmac/pcie.o and mt7932.o, no new warnings.
Hardware (one-shot test kernel 7.3.0-aurora-swl1 or -swl2 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Hardware (one-shot test kernel 7.3.0-aurora-swl1 or -swl2 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Hardware (one-shot test kernel 7.3.0-aurora-swl1 or -swl2 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Still to run
pci14e4,4434): Wi-Fi associates,dmesg | grep -i 'DMA'shows no brcmfmac mask error. The removed block never ran there, so its behaviour is unchanged. Hardware row: pending.Credit and reach
Eryk Wieliczko and Chris Kearney wrote the aperture helper and the T8132 mask; Chris Kearney wrote the mt7932 admission. Reach: BCM4388 on T6020/T6030/T6040/T8122/T8132 boards. On T8132 the helper sets the same 42-bit mask (J713 has a BCM4388 C2, revision 6). On the others, the removed block never ran, so nothing changes.
Assisted-by: LLM (Claude:Opus 5.5)