omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

MacBook BCM43602 (brcmfmac): Wi-Fi firmware wedges on resume from deep suspend — all commands fail with -5 until reboot

Open rleap opened this issue 1 month ago • 11 comments

What happens

On a MacBookPro12,1 (Broadcom BCM43602, brcmfmac), resuming from deep suspend often leaves the Wi-Fi firmware wedged. The driver stays bound and the interface still exists, but every command to the firmware times out, so NetworkManager can never bring the link up:

kernel: PM: suspend exit
NetworkManager[691]: <info>  device (wlp3s0): state change: unmanaged -> unavailable (reason 'managed', managed-type: 'external')
kernel: ieee80211 phy0: brcmf_msgbuf_query_dcmd: Timeout on response for query command
kernel: ieee80211 phy0: _brcmf_set_multicast_list: Setting mcast_list failed, -5
kernel: ieee80211 phy0: brcmf_msgbuf_query_dcmd: Timeout on response for query command
kernel: ieee80211 phy0: brcmf_cfg80211_get_channel: chanspec failed (-5)
kernel: ieee80211 phy0: brcmf_msgbuf_query_dcmd: Timeout on response for query command
kernel: ieee80211 phy0: brcmf_cfg80211_get_tx_power: error (-5)
NetworkManager[691]: <warn>  platform-linux: do-change-link[2]: failure 5 (Input/output error)
NetworkManager[691]: <warn>  device (wlp3s0): set-hw-addr: failed to set MAC address to 82:A9:77:B2:89:75 (scanning) (NME_UNSPEC)
kernel: ieee80211 phy0: brcmf_c_set_cur_etheraddr: Setting cur_etheraddr failed, -5

These repeat roughly every two seconds until the machine is rebooted (30, 63 and 58 occurrences in the three failing cycles below). The driver never resets the device. NetworkManager retries throughout and every attempt fails with the same -5/EIO, and in practice a reboot is the only thing that has recovered it.

Expected

Wi-Fi reconnects after resume, as it does on the cycles where brcmfmac happens to re-download firmware.

The failure is nondeterministic, not duration-dependent

Worth stressing, because it makes this easy to misdiagnose as "long suspends break Wi-Fi". It isn't. On resume brcmfmac sometimes re-probes and re-downloads firmware (works) and sometimes doesn't (wedges). Every suspend cycle in this journal:

suspended resumed duration outcome
2026-08-24 23:25 2026-08-24 23:25 12s clean, no reload needed
2026-08-24 23:47 2026-10-06 19:00 42d 19h recovered (fresh firmware)
2026-10-06 22:04 2026-10-16 20:41 9d 22h recovered (fresh firmware)
2026-10-16 22:03 2026-10-19 21:16 2d 23h wedged (58 timeouts)
2026-10-19 23:36 2026-10-20 21:22 21h 46m recovered (fresh firmware)
2026-10-20 22:12 2026-10-28 20:34 7d 22h recovered (fresh firmware)
2026-10-29 00:10 2026-10-29 18:52 18h 42m wedged (63 timeouts)
2026-10-29 21:22 2026-10-30 19:10 21h 48m wedged (30 timeouts)

21h46m recovered while 18h42m and 21h48m wedged; 2d23h wedged while 7d22h, 9d22h and 42d19h all recovered. The marker for a good resume is a brcmf_c_preinit_dcmds: Firmware: BCM43602/1 line near PM: suspend exit; its absence means the wedge.

Steps to reproduce

  1. Omarchy on a Mac whose Wi-Fi is driven by brcmfmac (BCM43602 here).
  2. Close the lid, leave it suspended for a few hours.
  3. Open the lid. Wi-Fi shows as disconnected and will not reconnect.
  4. journalctl -b -k | grep msgbuf_query_dcmd shows the repeating timeouts.

Expect to repeat this a few times — three of the eight cycles above failed.

Workaround

Reloading the driver across sleep makes the recovery deterministic. Dropping this in /usr/lib/systemd/system-sleep/ fixes it:

#!/bin/bash
set -u
sleep_action=${SYSTEMD_SLEEP_ACTION:-$2}
stamp=/run/brcmfmac-reload.unloaded

case $sleep_action in
suspend | hibernate | hybrid-sleep | suspend-then-hibernate) ;;
*) exit 0 ;;
esac

case $1 in
pre)
  if [[ -d /sys/module/brcmfmac ]]; then
    rmmod brcmfmac_wcc 2>/dev/null
    rmmod brcmfmac && touch "$stamp"
  fi
  ;;
post)
  if [[ -e $stamp ]]; then
    rm -f "$stamp"
    modprobe brcmfmac
  fi
  ;;
esac

Three details that matter:

  • Unload on pre, not post. Before suspend the firmware still answers, so teardown is clean and fast. Tearing down the already-wedged firmware on resume would stall ~2s per queued command (inferred from the timeout interval).
  • rmmod, not modprobe -r, so removal cannot cascade into cfg80211 or mmc_core.
  • modprobe, not insmod, so feature_disable=0x82000 from /etc/modprobe.d/brcmfmac.conf is reapplied. Without it the firmware's own WPA supplicant fails the four-way handshake and the network reads as a wrong password — i.e. losing it would reintroduce the exact bug that install/hardware/apple/fix-brcmfmac-supplicant.sh already fixes.

The stamp file means the hook stays inert if brcmfmac isn't loaded, so it is safe on hardware this doesn't apply to.

This would sit naturally next to the existing install/hardware/apple/fix-brcmfmac-supplicant.sh, gated on the same brcmfmac PCI ID list that script already carries.

How far this is verified

Confirmed: the hook fires in the right order (unload before PM: suspend entry, reload after PM: suspend exit), firmware re-downloads, zero timeouts, and NetworkManager reconnects in ~5s. That test was a 13-second suspend, so it proves the mechanism rather than a specific long-suspend case. The supporting evidence that a forced fresh probe is sufficient is in the table above: on the 7d22h, 9d22h, 21h46m and 42d19h cycles the firmware re-downloaded on its own and NetworkManager went on to reach ip-config and take a DHCP lease, with zero timeouts in the following 12 minutes. The hook makes that path run every time instead of occasionally.

Verified on BCM43602 only. The other IDs in that list (BCM4350/4355/4364 and the T2-era BCM4377/4378/4387) are untested here, so someone with that hardware should confirm before the gate is widened to them.

System details

  • Omarchy: 4.0.6-1
  • Kernel: 7.2.8-9-omarchy
  • Machine: Apple MacBookPro12,1 (Mac-E43C1C25D4880AD6), UEFI 489.0.0.0.0
  • CPU: Intel Core i5-5257U (Broadwell)
  • GPU: Intel Iris Graphics 6100 (Broadwell-U GT3)
  • Desktop: Hyprland 0.56.2
  • Wi-Fi: Broadcom BCM43602 802.11ac SoC (rev 01), 03:00.0, driver brcmfmac
  • Firmware: brcmfmac43602-pcie — BCM43602/1 wl0: Nov 10 2015 06:38:10 version 7.35.177.61 (r598657) FWID 01-ea662a8c
  • Sleep state: deep (S3)
  • NetworkManager: 1.58.1-2
  • Existing /etc/modprobe.d/brcmfmac.conf: options brcmfmac feature_disable=0x82000 (installed by Omarchy)

rleap avatar Oct 31 '26 02:10 rleap

Update: this chip also wedges while fully awake, with no suspend involved

Filing this as a comment rather than a new issue because the root cause looks identical, but it broadens the scope of this report: the premise in my title ("on resume from deep suspend") is too narrow, and the system-sleep hook I proposed above cannot fix this half of it. Suggest retitling to something like "Wi-Fi firmware wedges on resume from suspend and spontaneously while awake — all commands fail with -5/-12 until reboot".

Two boots today wedged with zero suspend events in the boot:

boot duration PM: suspend entry -5 timeouts commonring -12
2026-11-01 16:13:20 → 17:10:02 57m 0 63 220
2026-11-01 17:10:28 → 17:40:43 30m 0 63 96
2026-10-30 19:11 → 2026-11-01 16:12 (hook installed) 1d 21h 4 0 0

That third row is the sleep hook from this issue working as intended across four suspends — so the awake wedge is independent of it, not a hook regression.

No identifiable trigger

The first timeout in the 16:13 boot landed at 16:59:47, ~46 minutes in, with no scan, no MAC change, and no suspend anywhere before it. The link had been up and passing traffic. The last thing in the log before it is ordinary multicast, then the firmware simply stops answering:

16:59:32 kernel: [UFW BLOCK] IN=wlp3s0 ... SRC=192.168.1.6 DST=224.0.0.251 ...
16:59:47 kernel: ieee80211 phy0: brcmf_msgbuf_query_dcmd: Timeout on response for query command
16:59:47 kernel: ieee80211 phy0: brcmf_cfg80211_dump_station: BRCMF_C_GET_ASSOCLIST failed, err=-5
16:59:53 kernel: ieee80211 phy0: brcmf_msgbuf_query_dcmd: Timeout on response for query command
16:59:53 kernel: ieee80211 phy0: brcmf_cfg80211_dump_station: BRCMF_C_GET_ASSOCLIST failed, err=-5

I could not find a software lever here, so I don't think there is a prevention fix to ship — only a recovery one.

New mechanism detail: -5 decays into permanent -12 after ~6 minutes

Worth recording, because the second signature is what you actually find in the log if you look after the fact, and it is a different error entirely.

Each timed-out query appears to leak its slot in the msgbuf ioctl commonring. The ring is never reclaimed, so once it fills, -5 becomes -12 (ENOMEM) and stays there. In the 16:13 boot the first timeout was 16:59:47 and the first ring exhaustion 17:06:03 — 6m16s later, after ~63 timeouts at 6s intervals:

17:06:03 kernel: ieee80211 phy0: brcmf_msgbuf_tx_ioctl: Failed to reserve space in commonring
17:06:03 kernel: ieee80211 phy0: brcmf_cfg80211_dump_station: BRCMF_C_GET_ASSOCLIST failed, err=-12
...
17:08:10 NetworkManager[689]: <warn> platform-linux: do-change-link[2]: failure 12 (Cannot allocate memory)
17:08:10 NetworkManager[689]: <warn> device (wlp3s0): set-hw-addr: failed to set MAC address to A2:E3:1F:16:8E:4F (scanning) (NME_UNSPEC)
17:08:10 kernel: ieee80211 phy0: brcmf_c_set_cur_etheraddr: Setting cur_etheraddr failed, -12

So the timeout count per boot caps near 63 — not because it stops failing, but because the error code changes. Anyone grepping only for msgbuf_query_dcmd will undercount a long wedge.

Note also that a firmware timeout is never benign on this machine. Every boot that logged one ended in a forced reboot (63, 30, 63, 63). The boots that stayed healthy — including the 1d21h one above — logged exactly zero. That makes a short burst a reliable wedge signal, which is what the watchdog below keys on.

omarchy restart wifi cannot recover this

Worth flagging as the in-distro gap, since it is the obvious thing a user reaches for. It runs rfkill unblock wifi, nmcli networking on, nmcli radio wifi on and a rescan. None of those touch the firmware, so it has no effect on a wedged card — rebooting really is the only thing that works without reloading the driver. It might be worth having it detect an unresponsive brcmfmac and fall back to a driver reload.

Mitigation that works: watch the log, re-probe the card

Same insight as the sleep hook — only a fresh firmware download recovers the chip — but triggered by the failure signature instead of by sleep.

/usr/local/bin/brcmfmac-recover, the recovery action:

#!/bin/bash
set -u
iface_timeout=15
log() { logger -t brcmfmac-recover -- "$*"; echo "brcmfmac-recover: $*"; }

# Resolve the PCI address while the driver is still bound: the sysfs link
# disappears with the module.
dev=$(basename "$(ls -d /sys/bus/pci/drivers/brcmfmac/0000:* 2>/dev/null | head -1)" 2>/dev/null)
[[ -n $dev ]] || dev=$(lspci -D -d 14e4:43ba 2>/dev/null | awk '{ print $1; exit }')

wait_for_iface() {
  for ((i = 0; i < iface_timeout; i++)); do
    for w in /sys/class/net/*/wireless; do
      [[ -e $w ]] && { basename "$(dirname "$w")"; return 0; }
    done
    sleep 1
  done
  return 1
}

log "reloading brcmfmac"
rmmod brcmfmac_wcc 2>/dev/null
# Only check for an interface if the module actually unloaded: on failure the
# wedged netdev is still registered, so the check would pass and report a
# recovery without anything having been reset.
if rmmod brcmfmac; then
  modprobe brcmfmac || log "modprobe brcmfmac failed"
  if iface=$(wait_for_iface); then
    log "recovered via module reload ($iface)"; exit 0
  fi
else
  log "rmmod brcmfmac failed, going straight to the PCI re-probe"
fi

# The reload cannot help if the chip stopped responding on the bus at all.
log "re-probing $dev on the PCI bus"
[[ -w /sys/bus/pci/devices/$dev/remove ]] && { echo 1 >"/sys/bus/pci/devices/$dev/remove"; sleep 2; }
echo 1 >/sys/bus/pci/rescan
iface=$(wait_for_iface) && { log "recovered via PCI re-probe ($iface)"; exit 0; }
log "FAILED: still no wireless interface; a reboot is needed"; exit 1

/usr/local/bin/brcmfmac-watchdog, driven by a plain brcmfmac-watchdog.service (ExecStart=, Restart=always):

journalctl -k -f -n0 -o cat \
  -g 'brcmf_msgbuf_query_dcmd: Timeout on response|Failed to reserve space in commonring' |
  while read -r _line; do ... done

with: recover on 3 errors in 60s, a 120s cooldown afterwards, and a loud give-up after 3 recoveries in 10 minutes so dying firmware cannot become a reload loop. Both signatures are matched, because if the watchdog starts late the -12 lines are all that is left.

Two details that matter if you implement this:

  • -n0 is required. Without it, every service start or Restart=always replays the current boot's old errors and recovers for no reason.
  • rmmod, not modprobe -r, and modprobe, not insmod — for the same two reasons given for the sleep hook above, including keeping feature_disable=0x82000 applied.

This would sit next to the sleep hook, gated on the same brcmfmac PCI ID list install/hardware/apple/fix-brcmfmac-supplicant.sh already carries.

How far this is verified

Verified: detection through recovery end-to-end. Injecting the signature produced 3 firmware errors in 60s, recovering the card within 5s, a fresh brcmf_c_preinit_dcmds: Firmware: BCM43602/1 download, wlp3s0 back 2s later and NetworkManager reconnected with a DHCP lease — ~7s total, versus ~10 minutes of dead Wi-Fi plus a reboot. Threshold, cooldown and give-up cap are tested, as are both recovery branches.

Not verified: recovery against a real wedge. A wedge cannot be triggered on demand, so only the healthy-firmware reload path has actually executed; the PCI re-probe fallback exists for the case where reloading is not enough. I'll report back the next time the card dies on its own.

If you reproduce the test, one trap: injecting the signature into /dev/kmsg as brcmf_msgbuf_query_dcmd: Timeout on response ... silently does not work. journald's kernel parser splits a leading single-token identifier: into SYSLOG_IDENTIFIER and drops it from MESSAGE, so the stored message becomes just Timeout on response ... and no pattern keyed on the function name matches — it looks like the watchdog is broken when it isn't. Real kernel lines are prefixed ieee80211 phy0: , whose space defeats that parsing. Inject the full realistic prefix.

System details

Unchanged from the report above (MacBookPro12,1, BCM43602 03:00.0, firmware 7.35.177.61 from 2015-11-10, brcmfmac), except:

  • Omarchy: 4.0.6-1
  • Kernel: 7.2.8-9-omarchy
  • NetworkManager: 1.58.1-2
  • Suspends involved in the two wedged boots: none

rleap avatar Nov 02 '26 02:11 rleap

One deep-suspend cycle on a MacBookPro14,2, BCM43602 14e4:43ba, firmware 7.35.177.61, kernel 7.2.15-1-omarchy, Omarchy 4.5.0-3. The board NVRAM from #7671 is loaded (boardflags3=0xC0000303).

Before sleep the link was 2CrazyPups at 5280 MHz, signal about −49 dBm, receive rate 468 Mbit/s. Gateway pings were about 6 ms with no loss.

systemctl suspend entered S3 (PM: suspend entry (deep)). The clock jumped about 55 seconds. Resume logged two Thunderbolt warnings (tb_cfg_read during nhi_suspend_noirq). brcmfmac reloaded the 43602 firmware (brcmf_fw_alloc_request for BCM43602/2, then wlp2s0 renamed from wlan0). There was no firmware-halt message and no command failure of -5.

About five seconds after resume, NetworkManager reassociated. The link came back on the 2.4 GHz radio of the same SSID, 2417 MHz, signal about −54 dBm, receive rate 130 Mbit/s. Gateway pings then succeeded, about 9 ms, no loss. brcmf_inetaddr_changed logged err:-52 once while the address was being restored. That did not leave the interface dead.

So this kernel did not reproduce the "commands fail with -5 until reboot" failure on one S3 cycle. The driver did reload, and it chose 2.4 GHz instead of the 5 GHz BSS it had before sleep.

hanscnelson avatar Nov 05 '26 16:11 hanscnelson

Second deep-suspend cycle on the same MacBookPro14,2 (14e4:43ba, subsystem 106b:0157), now on Omarchy 4.5.0-3 and linux-omarchy 7.2.15-1. The board NVRAM was loaded, including the swctrlmap_2g correction from #7672.

PM: suspend entry (deep) at 11:27:44, PM: suspend exit at 11:29:50, same boot. brcmf_c_preinit_dcmds ran again for firmware 7.35.177.61. No brcmf_fw_crashed, no Retrieving cur_etheraddr failed, -5. The link came back on 2CrazyPups at 2417 MHz, about −31 dBm, and the gateway answered five pings at 6–11 ms with no loss.

This cycle did not hit the −5 wedge. It is still one machine and two suspends.

hanscnelson avatar Nov 05 '26 17:11 hanscnelson

Reproduced on the same MacBookPro14,2, Omarchy 4.5.0-3, linux-omarchy 7.2.15-1, firmware 7.35.177.61.

The earlier two single deep cycles on this machine reloaded the firmware and came back. This time the lid stayed closed and logind suspended four times in a row (the Alpine Ridge wake loop, #12194, with the #12211 wakeup mask and pcie_port_pm=off already applied). The firmware reloaded on those resumes (brcmf_c_preinit_dcmds at 12:14:40, 12:14:48, and 12:15:22). After the lid was opened:

  • brcmf_cfg80211_add_iface for p2p-dev-wlp2s0 failed, err=-5, then later err=-12
  • brcmf_c_set_cur_etheraddr failed, -5, then repeatedly -12
  • nmcli device wifi list was empty
  • nmcli connection up on the saved network returned "The Wi-Fi network could not be found"
  • rfkill showed no soft or hard block

No brcmf_fw_crashed line. The module was not removed. The interface is wlp2s0, still the placeholder MAC 00:90:4c:0d:f4:3e. A reboot is the recovery used here.

hanscnelson avatar Nov 05 '26 18:11 hanscnelson

Same failure on a second MacBookPro12,1, now on a kernel that carries the brcmf_detach() race fix, so the kernel fix alone does not prevent the wedge (as expected; it only makes the unbind/rebind workarounds safe).

System

  • Apple MacBookPro12,1, Omarchy 4.5.0-3, linux-omarchy 7.2.15-1 (built from stable 7.2.15, which includes 47ca6395a1d9)
  • BCM43602 14e4:43ba (rev 01), subsystem 106b:0133, 0000:03:00.0, driver brcmfmac, firmware 7.35.177.61 (r598657)
  • mem_sleep: s2idle [deep] (S3), NetworkManager 1.58.1-2 + wpa_supplicant, feature_disable=0x82000 installed by Omarchy
  • No sleep hook or unit for brcmfmac installed

Every suspend cycle in the last four boots

suspended resumed asleep outcome
2026-11-03 21:51:06 2026-11-03 21:51:24 18 s recovered (fresh firmware on wake)
2026-11-03 22:52:32 2026-11-04 17:38:33 18 h 46 m recovered (fresh firmware on wake)
2026-11-04 20:43:12 2026-11-04 20:50:14 7 min wedged: brcmf_msgbuf_query_dcmd timeouts every 2 s, set-hw-addr failed with EIO
2026-11-04 20:50:59 2026-11-05 09:39:28 12 h 48 m recovered: suspended while wedged; on wake three more timeouts, then brcmf_fil_cmd_data: bus is down, then a fresh firmware download
2026-11-06 08:44:44 2026-11-06 10:22:33 1 h 38 m wedged: 60+ timeouts, Couldn't initialize supplicant interface, scans failing with -5; dead for 1 h 53 m until reboot
2026-11-06 20:18:22 2026-11-07 14:25:44 18 h 07 m wedged: timeouts until reboot 20 s later

Three of six wedged. Duration does not predict it here either: 7 minutes wedged while 18 seconds, 18 h 46 m and 12 h 48 m recovered. The marker holds: every good resume has brcmf_fw_alloc_request: using brcm/brcmfmac43602-pcie right at PM: suspend exit, every wedge lacks it.

One detail I had not seen reported: the 2026-11-04 cycle shows that suspending the already-wedged card went through (no brcmf_pcie_pm_enter_D3 failure) and the next wake re-probed it. So on this firmware a second suspend can recover the card, though not reliably enough to count on.

Next step on this machine is the unit from #7333 (head e1f7b312), whose kernel gate now passes on the stock 7.2.15 kernel, in deep S3. That is the combination the reviews there still list as untested; results will go to #7333.

estcarisimo avatar Nov 07 '26 20:11 estcarisimo

Same wedge on a MacBookPro11,5 (BCM43602 14e4:43ba, firmware 7.35.177.61), Omarchy 4.5.0-3, linux-omarchy 7.2.15-1, radeon dGPU, S3 deep.

Without any hook, 1 of 10 short cycles (30 s to 3 min) wedged. One second after PM: suspend exit:

brcmf_msgbuf_process_ring_status: Firmware reported ring 0 error: 3
brcmf_msgbuf_query_dcmd: Timeout on response for query command
_brcmf_set_multicast_list: Setting mcast_list failed, -5
...
NetworkManager: device (wlp4s0): Couldn't initialize supplicant interface: Timeout was reached

About 10 min later it escalated to brcmf_msgbuf_tx_ioctl: Failed to reserve space in commonring / -12 on every command, until reboot. The Firmware reported ring 0 error: 3 line, immediately after resume, may be a useful early marker for the wedged path.

Workaround tested: a systemd-sleep hook that unloads the driver before suspend and reloads it after:

#!/bin/sh
# /usr/lib/systemd/system-sleep/mbp-brcmfmac
case "$1/$2" in
  pre/suspend|pre/hybrid-sleep|pre/suspend-then-hibernate) modprobe -r brcmfmac_wcc brcmfmac 2>/dev/null || true ;;
  post/suspend|post/hybrid-sleep|post/suspend-then-hibernate) modprobe brcmfmac || true ;;
esac

Result: 8/8 cycles clean (RTC and USB-keyboard wake, 45 s to 3 min). Wi-Fi was associated again about 20 s after wake every time. The only brcmf output was brcmf_fil_cmd_data: bus is down during the pre-suspend unload, which is harmless. Small sample, short sleeps only. Longer and lid-close cycles are next.


How this was produced: this comment was written by Claude Opus 5.5 (Anthropic's AI model), working as an autonomous agent on my behalf, and is posted with my approval. Method: hardware-in-the-loop testing on my own MacBookPro11,5. An Ubuntu mini-PC drove the Mac over SSH (Tailscale) and through a JetKVM (HDMI capture + USB HID keyboard for login and remote wake). A scripted S3 harness armed an RTC alarm (or sent a USB HID wake), suspended with systemctl suspend, waited for the Mac to return, then pulled the kernel journal for that cycle (journal cursor) and counted ring/IB/UVD results, GPU lockup/stall lines, si_dpm errors and brcmf failures into a JSONL log. Mesa builds (26.2.5 + patch, stock 26.0.8) were compiled in an Arch container and loaded only from a private prefix via LIBVA_DRIVERS_PATH. Nothing was installed system-wide. Decode tests used ffmpeg -hwaccel vaapi on generated 1080p30 clips. I did the physical power-button presses when the machine froze.

teuteuguy avatar Nov 09 '26 00:11 teuteuguy

Same chip, same failure, and a fix that has been running here since September — worth reading before adding another workaround, because https://github.com/omacom/omarchy/pull/10332 already covers it.

MacBookPro11,5, BCM43602 14e4:43ba rev 01 subsystem 106b:0152, firmware 7.35.177.61, identical -5/EIO signature.

A clean reproduction of the wedge, from a hookless deep S3 on AC (2026-10-21, 14 h asleep, module loaded throughout): on resume there is no brcmf_c_preinit_dcmds line, so the firmware was never re-downloaded; brcmf_msgbuf_query_dcmd: Timeout on response for query command then repeats every ~2 s, unbroken, with no recovery, and wpa_supplicant is eventually SIGKILLed on shutdown. Same nondeterminism you describe: when the driver does re-probe, everything is fine.

What fixes it here, in /usr/lib/systemd/system-sleep/:

  • pre: bring the interface down, modprobe -r brcmfmac_wcc brcmfmac with retries, log if it is still loaded.
  • post: modprobe brcmfmac, then brcmfmac_wcc.
  • Two conditions learned the hard way: skip the unload entirely when brcmf_msgbuf_query_dcmd: Timeout is already firing in the last five minutes (unloading a wedging chip wedges the stack — see below), and stop NetworkManager/wpa_supplicant first, because a plain modprobe -r races mid-teardown and fails silently.

Continuous since 2026-09-11 across deep S3 cycles, lid and RTC, and the wedge has not come back.

One hazard for any unload-based fix: unloading brcmfmac during a timeout cascade GPFs in _cfg80211_unregister_wdev, traced on https://github.com/omacom/omarchy/pull/7333 to a P2P interface removal race in brcmf_detach(). Upstream fixes it in 7.2.11 (08a3f02), which linux-omarchy 7.2.15 carries, so on current kernels this is much safer than it was — but a hook that unloads on an already-wedged chip will still find it on older ones.

Also relevant to the "reload fixes it" half: on 7.2.15 the reload runs against a firmware that may have lost its state on battery, which is a separate failure mode — https://github.com/omacom/omarchy/pull/11570#issuecomment-6261013315.

rand0mdud3 avatar Nov 13 '26 17:11 rand0mdud3

Codex High read the report and all follow-up comments, then checked the current quattro Wi-Fi restart command and Broadcom setup. omarchy restart wifi unblocks the radio and asks NetworkManager to enable Wi-Fi and rescan; it does not reset the driver or firmware. The reported failures while fully awake also remain relevant: a sleep hook would not run for those events.

I could not reproduce this hardware failure. I classified it as a hardware compatibility bug, but the separate DeepSeek V4.1 Flash classifier returned no class, so classification remains unsettled and no labels or verification were applied. Codex High was the only model to review the issue substantively in this run; it is waiting for classification review before further work.

omarchybot avatar Nov 18 '26 18:11 omarchybot

Classification is now agreed as a hardware compatibility bug. I checked current quattro at fee089f1647a4dc57e473c7c8df88478ee260b16, the report and the related recovery PRs. This environment has no BCM43602 hardware, so the failure was not reproduced and no tests ran.

@rleap, please test the sleep portion with #7333 at full commit 9ff07e4c72b624e88ff178a82a9bf30ec84fffa1, using its pinned helper/service installation instructions with sha=9ff07e4c72b624e88ff178a82a9bf30ec84fffa1. Use a stock, non-RC kernel at least 7.2.11. On the original 7.2.8 the helper stays inactive. Temporarily disable your own Broadcom sleep hook and stop/disable the watchdog during the test so they cannot mask the result.

Please report the full tested commit, current Omarchy/kernel versions, Mac model/PCI ID, selected /sys/power/mem_sleep mode, and several deep-suspend/lid-close cycles, including a longer sleep. For each cycle, note AC/battery, whether the card was already wedged before sleep, time until connectivity returned, and Wi-Fi band. Include journalctl -b -u omarchy-brcmfmac-suspend.service --no-pager plus kernel/NetworkManager logs covering any failure or unbind timeout. A firmware-load message alone is insufficient: the MacBookPro14,2 report here includes fresh loads followed by another wedge.

The awake failures remain unresolved: a sleep service cannot handle them. Do they still occur on your current kernel? If you have since recovered from a real awake wedge, please share the first timeout, later commonring errors, recovery log/action and whether connectivity returned. The injected-log and healthy-driver tests do not establish recovery from that state. This issue remains open awaiting those hardware results.

GPT-6 in Codex (effort setting not exposed) reviewed this with Opus 5.5 High and muse-wonder via pi (thinking high). Both agreed that the evidence does not establish a fix for the whole report; independence is not guaranteed. Opus highlighted the fresh-load-then-wedge counterexample above.

omarchybot avatar Nov 23 '26 03:11 omarchybot

Another data point, on a different chip: BCM4364 on a T2 Mac. The failure signature is the same.

  • MacBookPro15,2 (T2), BCM4364 14e4:4464 rev 03, firmware brcmfmac4364b2-pcie 9.30.503.0.32.5.92
  • Kernel 7.2.15-arch1-1-t2 (linux-t2), Omarchy 4.5.0-3

It wedged while awake, about 27 s before a suspend. Unlike the BCM43602 reports, the first errors were memory-allocation failures. The -5 timeouts started after them:

13:38:18.955 brcmf_msgbuf_rxbuf_ctrl_post: Failed to alloc SKB   (repeated)
13:38:33.299 brcmf_c_set_cur_etheraddr: Setting cur_etheraddr failed, -5
13:38:35.347 _brcmf_set_multicast_list: Setting BRCMF_C_SET_PROMISC failed, err=-5
13:38:43.539 brcmf_cfg80211_set_power_mgmt: error (-5)
13:38:45.598 systemd-sleep: Performing sleep operation 'suspend'...
13:44:08.012 brcmf_set_mpc: fail to set mpc                       (after resume)
13:45:36.682 brcmf_p2p_set_firmware: failed to update device address ret -5
...          brcmf_msgbuf_query_dcmd: Timeout on response for query command
             brcmf_run_escan: error (-5)
             brcmf_msgbuf_process_gen_status: Firmware reported general error: 9

The timeout/-5 loop then repeated every 2–5 s. Two more suspend/resume cycles did not recover it. At shutdown, NetworkManager and wpa_supplicant both hit their stop timeouts and were SIGKILLed. A reboot fixed it. This boot had been up for about 5.7 days with several earlier suspends that resumed fine.

At 13:38:18, the same moment as the first Failed to alloc SKB, a local speech-to-text app was loading a model onto the iGPU (Intel UMA, so system memory). There was no OOM-killer activity in the journal. I don't have a memory reading from that moment. My guess at the cause is a short burst of memory pressure making the driver's atomic SKB allocation fail, and the firmware never recovering from it. So a recovery path that only runs on resume would not have caught this one, because it started while the machine was awake.

I haven't tried modprobe -r brcmfmac && modprobe brcmfmac as a recovery yet. I can report back if it recurs.

jeff-mettel avatar Nov 27 '26 20:11 jeff-mettel

@jeff-mettel, your BCM4364 log shows receive-buffer allocation failures and subsequent -5 errors before suspend. In the brcmfmac source, that allocation supplies buffers for firmware events and command replies. Another MacBookPro15,2 with the same firmware saw allocation failures on resumes where Wi-Fi recovered, so memory pressure is still a hypothesis. The sleep service in #7333 covers BCM4350 and BCM43602. Related BCM4364 report in t2linux/kernel#32.

If it recurs, please share the kernel and NetworkManager logs from just before the first allocation error through recovery, the running kernel version, and a memory-pressure reading if you captured one near the onset. Please include what restored connectivity and whether Wi-Fi reassociated and passed traffic. Codex High was the only reviewer for this follow-up. Hardware reproduction is pending.

omarchybot avatar Nov 27 '26 20:11 omarchybot