Repository navigation
Conversation
The Pixel 9a's BCM4383 firmware (20.123.13) speaks shared-memory
("PCIe IPC") version 9. Accept it next to version 7, keyed on the version
the firmware reports rather than on a chip, and do what Broadcom's
driver does for it:
- read the EWP info block the shared area points to (offset 128) and
refuse to go on unless the firmware says its initialisation ended,
so a stalled firmware fails cleanly instead of leaving rings pointing
nowhere;
- bound every ring-info read and the fallback TCM index arrays to the
chip's RAM before trusting them;
- ring host-ready right after the common rings are set up, before any
buffer is posted (the 4389 path, now keyed on the version too), and
leave the aggregation host capability byte (offset 133) at zero;
- the no-DAR doorbells by the same test.
Version 8 stays refused: its layout is not known here. For the BCM4389
nothing changes: brcmf_pcie_early_hostready() is true for it by device
id as before, and the version 9 checks do not run on its version 7
firmware.
Tested on the Pixel 9a (BCM4383, API9): the firmware comes up, scans,
joins a WPA2 network and passes traffic. Not yet booted on the Pixel 7
Pro.
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The BCM4383 (PCI 14e4:4449, chip id 0x4383, rev 2) is the Wi-Fi chip in
the Pixel 9a. Add its ids, its SYSMEM base (0x6e0000, from the firmware's
load address) and the firmware name "brcmfmac4383-pcie" with the CLM
blob, and two firmware-keyed quirks for its 20.123.13 firmware:
- it takes only the versioned "join" parameters: the unversioned iovar
and SET_SSID both fail with -52, so enable BRCMF_FEAT_JOIN_V1 by the
same WLC version test as for the BCM4389;
- it advertises the supplicant offload but refuses the key
("failed to change PSK in firmware"), so leave FWSUP, SAE and FWAUTH
off and let the host do the handshakes.
Tested on the Pixel 9a with the owner's firmware set: wlan0 comes up,
scans, joins a WPA2 network through iwd and passes traffic, with no
module parameters.
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Thank you for this, and for splitting it the way I asked. I went through the version 9 commit The base. I can't merge into
I'll post here when step 2 is up. Before merge, please add to the description: the 9a's Small things, none blocking:
Nice work getting the 9a online. |
…l ones brcmf_pcie_bus_console_read() reads the firmware's console write index and walks read_idx up to it, wrapping at bufsize. When the device is gone the index reads 0xffffffff, which read_idx never reaches, and the walk never ends. Seen on a BCM4383 after s2idle on the Pixel 9a: the chip does not come back, the reset work entered this loop from brcmf_pcie_reset() and spun one CPU at 100 % with a stream of "CONSOLE:" lines of 0xff bytes. A later rmmod then blocked in cancel_work_sync() for good, holding the device lock, so the next shutdown would have hung in device_shutdown(). Return when the write index is outside the console buffer. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Added a third commit: bound the firmware console read when the device reads all ones. On the 9a the BCM4383 does not survive s2idle (it reads 0xff afterwards; the D3 path is still open). The driver's reset work then entered |
|
Thanks for the third commit, and for writing up how you found it. A console read that never ends because a dead link reads all ones is a nasty one to hit, and the fix is right. One suggestion: this commit has nothing to do with version 9 or the BCM4383, and the loop has been unbounded since brcmfmac's PCIe support first went in (it still is in linux-next). It also cherry-picks cleanly onto Where this PR stands on my side: I haven't done steps 1 and 2 yet. I'll do the Pixel 7 Pro boot with all of your commits, and then publish the BCM4389 series to (The commit's author date has the same |
|
Step 1 is done: I booted my Pixel 7 Pro with your three commits on top of the kernel it runs ( Step 2, publishing the BCM4389 series to |
|
Step 2 is done: the BCM4389 series is on |
|
Thanks for running step 1 and publishing step 2. I tried the rebase, and it isn't a clean one. The BCM4389 series on |
|
I looked closer, and the gap isn't in my commits:
My three commits generalise exactly those BCM4389 paths to API9 firmware, so they can only sit on top of them. Two ways forward, your choice:
I'd lean to 1, since they're your commits and you've run them on the 7 Pro. |
|
You're right, and I'm sorry for sending you off to rebase. I checked after your reply: I'll go with your option 1. They're my commits and they've run on the 7 Pro, so I'll curate the rest of the BCM4389 series (minus the debug-only commits) and publish it to |
|
One more commit: "wifi: brcmfmac: cfg80211: skip a BSS on a channel the wiphy doesn't list". On the palmtop (BCM4383), a boot of this branch's brcmfmac oopsed twice in the scan handler. |
|
Thank you, @W4HO-ham, for the fourth commit and for the clear write-up. The NULL channel is plain from the code: An update from my side, which I owe you from the 27th: the rest of the BCM4389 series is now curated as #143 (host capabilities, the no-DAR doorbells, early host ready, the ring-index fallback and the D3 control messages). It's still a draft and its head may move while I fix it, but the parts your commits build on are there. I tried it: I put your four commits on #143's head ( brcmf_pcie_copy_dev_tomem(devinfo, devinfo->shared.ring_info_addr,
&ringinfo, sizeof(ringinfo));
if (devinfo->shared.version == BRCMF_PCIE_SHARED_VERSION_9 &&
!brcmf_pcie_api9_valid_ringinfo(devinfo, &ringinfo))
return -EINVAL;
if (devinfo->shared.version >= 6) {With that, the other three commits apply as they are, and the gate on the result builds all four touched files with W=1, with Before it merges:
A suggestion for the new commit, not a blocker: on #143, The console-read fix and this one apply cleanly to |
|
7 Pro check done: your four brcmfmac commits on my phone's integration kernel (7.3.0-rc6-omamobile-push1-g291da0df9327; one conflict in |
brcmf_inform_single_bss() picks the band from the control channel number alone (2.4 GHz up to channel 14, 5 GHz above) and passes the result of ieee80211_get_channel() to cfg80211 unchecked. For a BSS whose channel has no entry in the wiphy's bands, such as a 6 GHz BSS taken for a 5 GHz channel number that doesn't exist, the channel is NULL, and cfg80211_inform_single_bss_data() dereferences it: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : cfg80211_inform_single_bss_data+0xb0/0x4fc [cfg80211] Call trace: cfg80211_inform_single_bss_data+0xb0/0x4fc [cfg80211] (P) cfg80211_inform_bss_data+0xbc/0x12d4 [cfg80211] brcmf_inform_single_bss+0x190/0x20c [brcmfmac] brcmf_cfg80211_escan_handler+0x2b0/0x474 [brcmfmac] brcmf_fweh_event_worker+0x384/0x520 [brcmfmac] This happened twice in one boot of a Pixel 9a (BCM4383) during scans, each time killing the event worker. Skip such a BSS with a debug message, as nothing can be reported for a channel the wiphy doesn't have. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
2305473 to
56ffdb3
Compare
|
Thank you, @W4HO-ham. The scan fix has its Things have moved since my comment this afternoon, so here's where I think this PR stands. #156's stack, as you rebased it under #178, already carries your first three commits: shared-memory version 9, the BCM4383 ID, and the bounded console read. They're the same patches, with the version 9 check placed after the ring-info copy as I suggested. So once #156 lands, they're in, and the rebase onto That leaves the fourth commit, the NULL-channel fix. It isn't in #156 or #178, and the bug is in both, as well as on
The Pixel 7 Pro run I did this afternoon covers the commit as it is. |
|
Thank you, @W4HO-ham. With the scan fix now in #191, and the first three commits riding in #187's stack, everything here has a home on |
The brcmfmac side of Wi-Fi on the Pixel 9a, in the order from #28 (omarchy-mobile): first the generic part, then the chip.
wifi: brcmfmac: pcie: support shared-memory version 9 firmware: the API9 handshake keyed on the version the firmware reports (EWP info check, bounded ring-info reads, early host ready and the aggregation capability byte, no-DAR doorbells by the same test; version 8 stays refused). For the BCM4389 nothing changes:brcmf_pcie_early_hostready()is true for it by device id as before, and the version 9 checks don't run on its version 7 firmware. That is the claim you wanted a cheetah boot for.wifi: brcmfmac: add BCM4383 PCIe support: ids, SYSMEM base, firmware name, and the two quirks keyed on the chip instead of module parameters:JOIN_V1by the same WLC version test as the 4389, and FWSUP/SAE/FWAUTH off because the 20.123.13 firmware refuses the PSK.Based on
omamobile-intrather thanomamobile: the version 9 code builds on the BCM4389 PCIe work (early host ready, host capabilities, the TCM copy helpers) that is in the integration snapshot but not onomamobileyet. Retarget as you see fit once that lands.Tested on the Pixel 9a today with this exact branch built as a module against the kernel it runs: loaded with no parameters, wlan0 comes up, iwd joins the WPA2 network, traffic flows, and the restricted DMA pool from #28 shows the bounce buffers in use (
/sys/kernel/debug/swiotlb/wifi-dma-pool/io_tlb_used). checkpatch --strict clean, W=1 clean. Not booted on the Pixel 7 Pro.Still to come, separately: the zumapro PCIe host glue (with the ASPM-off rationale and evidence) and the tegu DT.