Skip to content

device-panther: Wi-Fi, with the Pixel 7 Pro's files - #419

Closed
angelrenefm wants to merge 2 commits into
derekross:mainfrom
angelrenefm:pr-panther-wifi-pkg
Closed

angelrenefm wants to merge 2 commits into
derekross:mainfrom
angelrenefm:pr-panther-wifi-pkg

Conversation

@angelrenefm

@angelrenefm angelrenefm commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The package side of Wi-Fi for the Pixel 7, to merge with or before the kernel PR that enables it (derekross/linux-omarchy-mobile#195). As asked on #342, it is separate from the kernel change, and Bluetooth's files are left to nesmeck's device-panther update, as he proposed there.

The five files are the Pixel 7 Pro's, byte for byte (the test compares them with cheetah's): omamobile-wifi-start (PCIe controller, then brcmfmac, behind its hang marker) with its unit, enabled for multi-user.target; omamobile-wlan-mac with its udev rule (the MAC address the bootloader writes into the device tree); and the modprobe drop-in that blacklists pcie_gs201 and brcmfmac for autoload. The unit only runs when the DTB enables the PCIe controller, so on today's panther kernel it skips itself.

test/all's rule "starts nothing that drives hardware" becomes "starts only the USB rescue and the guarded Wi-Fi", and still fails on any other unit (boot-success, the charger, the AoC, a camera). The package version is left for you to set.

Tested on a second Pixel 7 with the same files installed by hand (same sha256 as this package's), on kernels with the Wi-Fi nodes and linux-omarchy-mobile#181's series under them (details in the commit): with the unit enabled, it brought wlp1s0 up about 5 s into boot and it connected. After s2idle tests that unloaded Wi-Fi, omamobile-wifi-start --retry brought wlp1s0 back and it reconnected.

Checks: packages/omamobile-device-panther/test/all (17 ok), tools/pr-check origin/main.

Not tested: a kernel with the Wi-Fi nodes alone (the ones above also had the Bluetooth nodes); installing it with pacman (only the same files by hand); power use; s2idle with Wi-Fi loaded; cheetah's sleep hook that unloads Wi-Fi around s2idle is not in this PR.

I used AI help (Claude) to work on this.

The Pixel 7 has the 7 Pro's BCM4389 on the same PCIe controller, and its
bootloader writes the same wlan_mac1 into the device tree. So the package
takes the 7 Pro's Wi-Fi guard, its unit and autoload blacklist, and the
MAC address helper with its udev rule, byte for byte; test/all checks
the copies against device-cheetah, as it does for the other shared files.
Bluetooth's files come with nesmeck's Bluetooth change.

omamobile-wifi.service is enabled, as on the 7 Pro. That changes the
test's old rule that nothing here starts hardware: Wi-Fi is now the one
radio started at boot, and only through its guard (hang marker, modules
blacklisted for autoload, no SysMMU firewall, and the unit only runs
when the DTB enables 14520000.pcie). On a kernel without the Wi-Fi node
it is skipped. The test now fails on any other wants link, and still
fails on the boot-success marker, the charge guard, AoC and cameras.

On a Pixel 7 the files, copied by hand, have the same sha256 as these.
On 7.3.0-rc6-omamobile-push1-g4446f52aefe8 (omamobile fe9627c00 with
linux-omarchy-mobile#181's series and the 7 Pro's Wi-Fi and Bluetooth
nodes), Wi-Fi was started by hand: wlp1s0 came up with the phone's own
firmware and saw networks. On the next boot (the same kernel plus a CMA
change, g3631214cc15a) the enabled unit brought wlp1s0 up about 5 s into
boot, and it connected.

I used AI help (Claude) to work on this.
@angelrenefm angelrenefm changed the title device-panther: Wi-Fi and Bluetooth, with the Pixel 7 Pro's files device-panther: Wi-Fi, with the Pixel 7 Pro's files Nov 4, 2026
@derekross

Copy link
Copy Markdown
Owner

Thank you, @angelrenefm. Taking cheetah's files byte for byte, with a test that compares them, is the right way to do this, and I checked all five against the 7 Pro's package: identical. The unit's ConditionPathExists keeps it quiet on today's kernel, the blacklist makes the guarded script the only thing that loads the drivers, and the firmware stays the phone's own. Your package test passes on the branch (CI is waiting for my approval because this is your first PR here, so I ran it myself).

One change before it goes in:

Sleep. On the 7 Pro, omamobile-sleep unloads Wi-Fi before every suspend unless /etc/omamobile/wifi-keep-across-sleep exists, and goes back to unloading for the rest of the boot if a wake ever fails in the Wi-Fi device. With this package, Wi-Fi stays loaded through every suspend on the Pixel 7, with no fallback, and that hasn't run on a Pixel 7 yet (your suspend tests unloaded it first, as you wrote). The first suspend on the Pixel 7 would then test two new things at once. Either of these would settle it:

  • copy cheetah's bin/omamobile-sleep and vendor/systemd/system-sleep/omamobile as they are, with the same cmp test as the other files, so Wi-Fi unloads around sleep by default as on the 7 Pro; or
  • run a short, attended series of RTC-woken suspends with Wi-Fi loaded (Wi-Fi reconnects after each, no brcmfmac errors in dmesg), and record it with the kernel release.

The first is less work and keeps the Pixel 7 on the 7 Pro's default.

At merge I'll set the version (the next free one; 0.1.6 and 0.1.7 are taken) and, if that's all right with you, retitle it to "device-panther 0.1.N: Wi-Fi at boot with the Pixel 7 Pro's guarded start", since "the Pixel 7 Pro's files" could read as the 7 Pro's firmware. If you touch the README, the same applies there. This one merges before linux-omarchy-mobile#195, so the blacklist is on every Pixel 7 before a kernel with the Wi-Fi node reaches it.

If you post a tools/phone-smoke report from a boot with the package's files and the unit enabled, that would complete the record. It isn't a blocker.

Thanks for splitting the Wi-Fi and Bluetooth work so cleanly with nesmeck.

Copy the Pixel 7 Pro's bin/omamobile-sleep and its system-sleep link
unchanged, so the Pixel 7 keeps the 7 Pro's default: Wi-Fi unloads
before every suspend and reloads through the guarded service after,
unless /etc/omamobile/wifi-keep-across-sleep exists, and goes back to
unloading for the rest of the boot after a wake that fails in the
Wi-Fi device. Before this, Wi-Fi would have stayed loaded through every
suspend on the Pixel 7, which hasn't run there yet.

The package test compares the script and the link with cheetah's, like
the other copied files, and checks that both are staged. Checked that
the test fails when either copy drifts.

Not run on the phone: no suspend has been done with this package.

I used AI help (Claude) to work on this.
@angelrenefm

Copy link
Copy Markdown
Contributor Author

Thanks, Derek. I took the first option: bda4f37 copies cheetah's bin/omamobile-sleep and its vendor/systemd/system-sleep/omamobile link unchanged, so Wi-Fi unloads around sleep by default on the Pixel 7, as on the 7 Pro.

  • test/all compares both with cheetah's (cmp for the script, readlink for the link) and checks that install stages them. I checked that it fails when either copy drifts: one extra line in the script, and the link pointed elsewhere.
  • I also tried the branch merged onto today's main (with omamobile-device-panther 0.1.9: the camera start and the DMA heap rule (from #428 and #430) #443's cameras), resolving the README, install and test/all conflicts by hand only to test: the package test passes there too, sleep and camera checks included. I didn't push that merge, since you said you'd take the conflicts yourself.

Not checked: no suspend has run on the Pixel 7 with this package, and I don't have a tools/phone-smoke report from a boot with it yet.

I used AI help (Claude) to work on this.

@angelrenefm

Copy link
Copy Markdown
Contributor Author

Tested on my Pixel 7 tonight, with the package built from this branch merged onto today's main (the conflicts resolved as in my last comment, version set locally to 0.1.9.1 so a real release replaces it), installed with pacman -U, kernel 7.3.0-rc6-omamobile-push1-g44048a9aa795:

  • ls -l /usr/lib/systemd/system-sleep/omamobile → /usr/bin/omamobile-sleep.
  • Three systemctl suspend cycles, each woken by rtcwake -m no -s 20, no wifi-keep-across-sleep file. Every cycle: omamobile-sleep: Wi-Fi unloaded for sleep, s2idle entry and exit, Wi-Fi reload queued, omamobile-wifi: up: wlp1s0, and wlp1s0 had its IPv4 address back about 6 s after the wake. suspend_stats: success 0 → 3, fail 0, no last_failed_dev. Wake IRQ each time: s2mpg12-pmic (the RTC).
  • dmesg after the reloads shows WLC_SET_ROAM_TRIGGER error (-52) and add iface p2p-dev-wlp1s0 type 10 failed: err=-5 once per load; both are in this boot's first load at 17:01 too, so they're not from sleep.

phone-smoke from the same boot, before the cycles:

phone-smoke: unknown

Kernel 7.3.0-rc6-omamobile-push1-g44048a9aa795, tools at unknown, 2026-11-05T22:00Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g44048a9aa795, slot b, up 21570s
storage guard (required) ok 55 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 96G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg (0 known, 0 new)
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card2-DSI-1 connected, 1080x2400
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok FocalTech FT3658
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 91% Charging, 28 °C
sound cards ok googleaocsndcar
sensors ok Accelerometer AmbientLight Proximity
cameras skip no libcamera tools
thermal ok hottest zone 54 °C

Packages: hyprland 0.57.0-3.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.13-1, omamobile-device-panther 0.1.9.1-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.32-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.100-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

Not checked: a longer or unattended sleep, and sleep with Wi-Fi kept loaded (wifi-keep-across-sleep), which stays the 7 Pro's opt-in.

I used AI help (Claude) to work on this.

@nesmeck

nesmeck commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@angelrenefm @derekross, a data point for the sleep default here, from my Pixel 7 with Wi-Fi kept loaded across sleep (the opt-in), in case it helps settle it.

With Wi-Fi kept loaded, the BCM4389's firmware (20.101.91) sometimes traps as the host resumes it from D3hot, and then answers nothing until the driver stack is reloaded. The firmware console (brcmfmac debug=0x00100000) shows the same trap every time:

THREADX TRAP INFO:
TRAP 4(326d68): pc 27489a, lr 27488d, sp 326fc0, cpsr 60000193, spsr 60000033

After it, every query times out ("Timeout on response for query command") and Wi-Fi stays down. Reloading brcmfmac_wcc brcmfmac pcie_gs201 and restarting omamobile-wifi.service brought it back every time; the two times I timed it, Wi-Fi was connected again 8 s later.

How often it happened depends on how the phone was put to sleep (all with Wi-Fi's PCI wake off, on omamobile plus local test patches):

Sleep Resumes Traps
rtcwake -m freeze (straight into the kernel) about 73 4
systemctl suspend (the way the phone sleeps in use) 181 0

My guess is that with systemctl suspend NetworkManager takes Wi-Fi down before the kernel suspends, while with rtcwake brcmfmac disconnects inside its own suspend callback. That is not proven, and 181 clean resumes don't show the trap can't happen on the normal path.

So I agree with keeping the 7 Pro's default for the Pixel 7: with Wi-Fi unloaded around sleep, a firmware that traps at resume can't matter, because the driver loads fresh at every wake. Your three cycles match what I see in that mode.

For keeping Wi-Fi loaded later, I have two follow-ups locally, not for this PR:

  • a small check after resume that reloads the stack when the firmware stops answering;
  • a brcmfmac patch that reads the firmware's trap flag and reports it within 10 ms instead of timing out.

I'll open them separately once this and linux-omarchy-mobile#195 are in.

🤖 Generated with Claude Code

@angelrenefm

Copy link
Copy Markdown
Contributor Author

Thanks, @nesmeck, that's a useful number to have on the record. It matches what I'd hope from the default: with Wi-Fi unloaded around sleep, a trap at resume can't leave the phone without Wi-Fi, since the driver loads fresh at each wake. Nothing changes in this PR, then; I'll leave wifi-keep-across-sleep as the opt-in and keep an eye out for your two follow-ups.

I used AI help (Claude) to work on this.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @angelrenefm. Taking cheetah's sleep hook as it is was exactly what I hoped for, and I checked: the script and the link are byte for byte the 7 Pro's, and the test catches a drifted copy. The three suspend cycles with the package really installed close the loop nicely: Wi-Fi unloads, the phone wakes on the alarm, and wlp1s0 is back within seconds every time. Thanks also, @nesmeck, for the numbers with Wi-Fi kept loaded. Four traps in about 73 direct freezes, and none in 181 suspends through systemd, is a clear reason to keep the 7 Pro's default here, and I'm looking forward to your two follow-ups.

This is ready. I'll take the conflicts with the camera work myself, as I said. For the record, the resolution needs one line that a plain "keep both" misses: your test's list of allowed boot-time links needs main's omamobile-camera.timer too, or the package test fails. The resolved package test passes on today's main, sleep and camera checks included.

At merge I'll set the version to 0.1.10 and use the title "device-panther 0.1.10: Wi-Fi at boot with the Pixel 7 Pro's guarded start, unloaded around suspend". This goes in and gets published before linux-omarchy-mobile#195, so every Pixel 7 has the autoload blacklist before a kernel with the Wi-Fi node reaches it.

One small thing, nothing to do now: the README row says Wi-Fi kept loaded across suspend hasn't run on a Pixel 7. After nesmeck's report it has, with the occasional firmware trap on resume, so that line can change when his follow-ups land.

derekross added a commit that referenced this pull request Nov 7, 2026
…tart, unloaded around suspend (#419) (#475)

The Pixel 7's Wi-Fi (BCM4389 on PCIe) starts at boot through the Pixel 7 Pro's guarded start: the PCIe controller, then brcmfmac, behind a hang marker, with the modules blacklisted for autoload and the unit run only when the DTB enables the controller. The link gets the bootloader's MAC before NetworkManager takes it. The Pixel 7 Pro's sleep hook, copied byte for byte, unloads Wi-Fi around suspend unless /etc/omamobile/wifi-keep-across-sleep exists. Three attended suspend cycles with the package installed all woke and reconnected.

Merged onto main with the conflicts against the camera work (#443) resolved; the test's list of boot-time links also takes omamobile-camera.timer.

Co-Authored-By: Ángel René <17342133+angelrenefm@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Merged through #475 (device-panther 0.1.10), with the conflicts against the camera work resolved as promised and you credited as co-author. Thank you, @angelrenefm! linux-omarchy-mobile#195 can go in once this is published in tomorrow's development build.

@derekross derekross closed this Nov 7, 2026
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…tart, unloaded around suspend (derekross#419) (derekross#475)

The Pixel 7's Wi-Fi (BCM4389 on PCIe) starts at boot through the Pixel 7 Pro's guarded start: the PCIe controller, then brcmfmac, behind a hang marker, with the modules blacklisted for autoload and the unit run only when the DTB enables the controller. The link gets the bootloader's MAC before NetworkManager takes it. The Pixel 7 Pro's sleep hook, copied byte for byte, unloads Wi-Fi around suspend unless /etc/omamobile/wifi-keep-across-sleep exists. Three attended suspend cycles with the package installed all woke and reconnected.

Merged onto main with the conflicts against the camera work (derekross#443) resolved; the test's list of boot-time links also takes omamobile-camera.timer.

Co-Authored-By: Ángel René <17342133+angelrenefm@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants