Skip to content

Work around Apple BCM4350 suspend failures - #7180

Draft
doctor wants to merge 1 commit into
omacom:quattrofrom
doctor:fix/apple-bcm4350-suspend
Draft

doctor wants to merge 1 commit into
omacom:quattrofrom
doctor:fix/apple-bcm4350-suspend

Conversation

@doctor

@doctor doctor commented Aug 16, 2026

Copy link
Copy Markdown

Summary

  • Install a sleep service only on Apple systems with the BCM4350 PCI device (14e4:43a3).
  • Unbind that device from brcmfmac before sleep and bind it again after wake, forcing a clean firmware initialization.
  • Add an idempotent migration for existing installs and focused coverage for hardware gating, service ordering, recovery state, and installation.

Failure

This was reproduced twice on a MacBook10,1 with kernel 7.1.8 and the in-tree brcmfmac driver.

After a successful S3 suspend, the BCM4350 firmware stopped answering as soon as the machine resumed. The journal then repeated:

brcmf_msgbuf_query_dcmd: Timeout on response for query command
Couldn't initialize supplicant interface: Timeout was reached
brcmf_cfg80211_scan: scan error (-5)

Toggling Wi-Fi could not recover the device because that only changes NetworkManager/rfkill state. A later suspend attempt also failed when the already-unresponsive firmware did not acknowledge its D3 transition:

brcmf_pcie_pm_enter_D3: Timeout on response for entering D3 substate
pci_pm_suspend(): brcmf_pcie_pm_enter_D3 [brcmfmac] returns -5

A reboot recovered Wi-Fi by initializing the firmware again.

Approach

The service keeps this exact PCI device unbound for the sleep transaction. It therefore avoids relying on the unresponsive firmware power transition and binds the device after resume so NetworkManager receives a freshly initialized radio.

The workaround is deliberately limited to Apple hardware with PCI ID 14e4:43a3; it does not cycle other brcmfmac radios.

Testing

  • bash -n on the helper, installer, migration, and test
  • test/shell.d/brcmfmac-suspend-test.sh
  • test/shell.d/brcmfmac-supplicant-test.sh
  • test/shell.d/unowned-system-paths-test.sh
  • test/shell.d/systemd-test.sh
  • test/cli
  • systemd-analyze verify install/hardware/apple/omarchy-brcmfmac-suspend.service
  • Live PCI unbind/bind: the device stayed detached and NetworkManager reconnected after binding
  • Live deep-suspend integration with the actual unit ordering:
    • service started before sleep.target
    • S3 suspend ran from 13:10:07 to 13:10:43
    • service stopped and firmware initialization began at 13:10:43
    • Wi-Fi activated at 13:10:47
    • zero brcmfmac response timeouts and zero post-resume scan failures

An earlier exploratory module-unload approach was discarded because udev immediately reloaded the module before suspend. That exploratory cycle also coincided with an snd_hda_codec kernel oops and a hard lock. The final implementation does not unload modules; both the corrected detached-device cycle and the actual service integration cycle completed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants