Repository navigation
wifi: brcmfmac: add capability-gated LPAS associated sleep - #1216
Closed
RyanTheTide wants to merge 6 commits into
Closed
RyanTheTide wants to merge 6 commits into
RyanTheTide wants to merge 6 commits into
Conversation
The BCM4378 and BCM4387 on Apple Arm systems retain firmware across the existing D3 path, but their endpoint does not advertise standard D3hot PME. The platform has a separate wake route, so using PME as the firmware feature-probe gate prevents cfg80211 from ever keeping an association. Split transport retention from host wake routing, retain the standard PME test, and opt only the public Apple Arm BCM4378/4387 identities into the platform wake route. Require successful wowl and wowl_cap probes before advertising anything. Make WoWLAN setup transactional. Check each retained-state operation and unwind to cfg80211's ordinary disconnect fallback on failure. Restore the bus WoWLAN state on resume. Firmware without the public capability therefore keeps the previous behavior. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Replace the Apple machine quirk with wakeup-source permission and an allocated MSI. Keep the firmware capability gate and the ordinary PCI PME path. After the firmware host-sleep acknowledgment, arm the IRQ and keep the PCI function in D0 using pci_save_state(), so PCI PM also retains its upstream bridges. Limit this in-band route to s2idle. Account for an early interrupt before suspend_device_irqs(), and balance wake arming on resume, thaw, suspend failure and IRQ teardown. Use explicit enable_irq_wake() rather than automatic wakeirq arming so an arming failure can refuse suspend and restore the bus. The wiphy resume callback then clears the firmware policy on the PM unwind. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Track the wakeup source created for a DT-selected MSI separately from pre-existing PCI wake capability. On IRQ teardown, remove only the source we created and restore the original capability. Leave an already enabled source owned by the bus or platform intact. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Firmware with the lpas capability can retain an association without the standard wowl iovar. Advertise only the generic WoWLAN any trigger when retained transport and a wake route are both available.\n\nSave PM, ARP/ND, packet-filter, event-mask and link-event policy, install a minimal public unicast filter, and enable lpas last. Unwind every completed step on failure so cfg80211 can use its ordinary disconnect fallback. Restore the saved policy after the existing D0/HOSTREADY path and report an unspecified wake reason.\n\nSigned-off-by: Ryan Murray <[email protected]>\nAssisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Build the two-byte mask and pattern through the dynamically allocated packet-filter buffer rather than indexing past the protocol structure's historical one-byte tail declaration.\n\nSigned-off-by: Ryan Murray <[email protected]>\nAssisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Contributor
Author
Contributor
Author
|
Superseded by #1232. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some BCM4378/BCM4387 firmware advertises
lpasbut rejects the publicwowliovar. Teach brcmfmac to use a capability-gated associated-sleepfallback without claiming standard WoWLAN features that the firmware cannot
report.
This series:
captokenlpastoBRCMF_FEAT_LPAS;WIPHY_WOWLAN_ANYfor LPAS-only firmware; and1to cfg80211's normaldisconnect fallback after any setup failure.
The LPAS path saves PM, ARP/ND, packet-filter, event-mask and
nolinkupstate. It selects
PM_MAX, keeps the existing ARP/ND host-address tablesactive, installs the public minimal unicast packet filter, enables the
disconnect/security event mask, and sets
lpaslast. Resume clears LPAS,restores the saved policy, and reports an unspecified wake reason. Standard
firmware continues to use the existing
wowlpath; firmware withoutlpasdoes not expose the fallback.
No chip-ID LPAS allowlist, Apple-only mailbox bit, GPIO wake path, PME quirk,
beacon tuning, TKO setup, flowring deletion, or firmware reload is added.
Build verification
Authoritative controller build receipt:
This worker did not use target hardware.
Hardware verification plan
All target work must use controller-approved one-shots. Preserve
speakerguardd, the M2 macOS volume, and the read-only xART ledger. Do not add
display, presence, idle, playback, or time-of-day gates.
Preflight on each reference Mac
captokens,wowlresult, LPAS gate, MSI number/count, PCI state, wakeupstate, association/BSSID, station connected time, IP addresses, routes,
flowring inventory, and error counters.
anyand thatiw phy ... wowlan showreflects it.M2 j413 / BCM4387
current disconnect/reassociate behaviour.
and one D3 acknowledgement, no firmware reload/cold reprobe, the same BSSID
with increasing connected time, retained peer/flowring identities, retained
IP lease and immediately usable gateway traffic, restored LPAS/PM/event
state, and no brcmfmac error, txstatus underflow, D3 timeout, warning, or new
AVC.
ANYfilter. Require the WLAN MSI count to increase and the machine to wakebefore RTC; preserve the first packet or explicitly account for it.
must roll back to a usable connected or deliberately disconnected interface,
and neither may leave firmware in host sleep.
M1 Pro / claimed BCM4378
report that and do not call it a BCM4378 qualification.
twenty candidate cycles, and the same invariants used on M2.
lpastoken, different ND payload version, or absent in-band MSIroute must suppress only the LPAS fallback; it must not weaken the BCM4387
path or introduce a chip-ID quirk.
Review notes
drivers/net/wireless/broadcom/brcm80211/brcmfmac/.wakeup-sourceMSI route used by theexisting wake series; this PR does not add board DT changes.
before this draft is marked ready.