[PATCH wireless-next v3 0/5] wifi: brcmfmac: pcie: S3 and deep sleep on the T2 Mac chips

From: Andre Eikmeyer

Date: Fri Nov 27 2026 - 12:36:18 EST


These are follow-ups to Michael Reeves' BCM4388 series, which is now
in wireless-next.

- Patch 1: D0_INFORM on resume now goes through the control ring,
which refuses to write while the PCIe state is DOWN. Set the state
first.
- Patch 2: The BCM4364 halts on the host ready doorbell at init. Skip
the doorbell there.
- Patch 3: The BCM4364 and BCM4377 come back from S3 without firmware.
Probe them again.
- Patch 4: The BCM4377 returns the tx status only once the flowring
delete is sent. Do not wait for it before.
- Patch 5: Add deep sleep for the BCM4364 and BCM4377, so the package
reaches PC10.

Patch 3 reuses the existing re-probe in brcmf_pcie_pm_leave_D3().
"wifi: brcmfmac: pcie: recover from fatal PCIe errors" [3] adds a
second re-probe after a PCIe error.

Both run under the device lock, but a PCIe error during resume can
still start both. Whichever series lands second should skip the
re-probe in brcmf_pcie_pm_leave_D3() while in_pci_recovery is set.

Patch 5 does not wake a device that is down, so the remove after a
link reset does not stall.

The Bluetooth function of the BCM4377 gets the same resume handling in
"Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM" on
linux-bluetooth.

Successfully tested with S3 and deep sleep on the BCM4364B2
(MacBookPro15,1), the BCM4364B3 (MacBookPro16,1) and the BCM4377
(MacBookAir9,1).

The T2 Linux community runs v2 of this series.

Changes in v3:
- Rebased on wireless-next, which has Michael's series now
- Patch 1: add the Fixes tag and Arend's Ack
- Patch 2: limit it to the BCM4364, B2 and B3, reword the commit
message and add the Fixes tag
- Patch 3: limit it to the BCM4364 and BCM4377
- Patch 4: keep the wait on all chips but the BCM4377. On the BCM4364B3
a tx status came after the delete response once, so it keeps the
wait as well. Commit ae13aa2ec885 already resets the counter when a
flowring is created
- Patch 5:
- limit it to the BCM4364 and BCM4377 with the mailbox on the
control ring
- check for the interrupt thread instead of in_irq
- handle a deep sleep message that fails to send
- wake the device in remove, disable deep sleep under ds_lock and
cancel the deassert work right after, before brcmf_detach() frees
the rings the work writes to
- give up waking a device that is not up
- clear ds_suspend when entering D3 fails
- DS_INBAND_DW comes on top of DS_NO_OOB_DW, as Broadcom's DHD driver
sets it

[1] v2: https://lore.kernel.org/all/20261111120748.23795-1-dev@deq.rocks/
[2] v1: https://lore.kernel.org/all/20261107154810.89780-1-dev@deq.rocks/
[3] https://lore.kernel.org/all/20261105215954.184290-1-sorencoremans@xxxxxxxxx/

Andre Eikmeyer (5):
wifi: brcmfmac: pcie: set the state before D0_INFORM on resume
wifi: brcmfmac: pcie: skip the host ready doorbell at init on the
BCM4364
wifi: brcmfmac: pcie: probe again after a resume through firmware
wifi: brcmfmac: msgbuf: do not wait for tx status on the BCM4377
wifi: brcmfmac: pcie: support inband device wake and deep sleep

.../broadcom/brcm80211/brcmfmac/commonring.c | 14 +
.../broadcom/brcm80211/brcmfmac/commonring.h | 5 +
.../broadcom/brcm80211/brcmfmac/msgbuf.c | 10 +-
.../broadcom/brcm80211/brcmfmac/pcie.c | 323 +++++++++++++++++-
4 files changed, 344 insertions(+), 8 deletions(-)


base-commit: 18d0bedbb5f0538396cb7f763ed9cd1dd69c5b23
--
2.56.0