Skip to content

wifi: apple: centauri: t6050: harden keep-alive sleep fallback, PME gating, and 27.2 TLV 280 - #2877

Open
DjDeveloperr wants to merge 2 commits into
mainfrom
fix/centauri-t6050-sleep-hardening
Open

DjDeveloperr wants to merge 2 commits into
mainfrom
fix/centauri-t6050-sleep-hardening

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 22, 2026 •

Copy link
Copy Markdown

Follow-up hardening for #2718 on T6050 N1 deep sleep, split into two commits:

Commit 1: wifi: apple: centauri: t6050: harden keep-alive sleep fallback and PME gating (6fb60db5532e)

  • Associated WoWLAN-off warm-reset fallback & TX drain: Drain in-flight data_tx_busy[] completions in wifi_disconnect(), and skip keep-alive in favor of the existing warm-reset teardown when cfg80211_leave_all() just disconnected during wiphy_suspend() (centauri_t6050_wifi_pm_disconnected()). With WoWLAN off (the default), sleeps while associated take the warm-reset path; keep-alive applies only to WoWLAN-armed or unassociated sleeps.
  • Keep-alive unwind error handling: Unwind Control and Alpha ACIPC host-sleep before fallback centauri_t6050_quiesce(), logging any wake failure, marking Wi-Fi failed (centauri_t6050_wifi_mark_failed()) so teardown skips dead ACIPC commands, and scheduling recovery (apple_centauri_sleep_recovery_needed(), also covering aborted suspends where resume/rewake may not run); check alpha_resume_locked() unwind inside centauri_t6050_wifi_suspend() as well. In cen_quiesce(), wake Beta ACIPC (clearing running if wake fails) before hci_unregister_dev().
  • Post-fence fn1/fn2 pci_save_state() refresh: Because cen_suspend() runs before centauri_t6050_suspend() and calls pci_save_state(fn2) while Bus Master is enabled in keep-alive mode, refresh pci_save_state() for fn 1/2 in centauri_t6050_domain_fence() only when centauri_t6050_stop_dma() succeeded for that function, and clear state_saved otherwise (or if pci_save_state() fails, handing suspend_noirq state save and power-state selection back to the PCI core). This prevents an aborted suspend after a Control fallback from restoring Bus Master and the pre-quiesce header onto a quiesced function whose DMA arena was already freed, while avoiding snapshotting 0xffff on an unreadable/gone function.
  • D3hot PME gating & sparse casts: Gate PCI_PM_CTRL_PME_ENABLE in D3hot on centauri_t6050_wifi_wowlan_armed() (fn 0/1) and device_may_wakeup() && running (fn 2), update the stale D3hot PME_En overview comment in centauri_pci.c, and add (__force u16) casts for PCI_D3hot/PCI_D0 in btcentauri_t6050.c. Because btcentauri_t6050 does not call device_init_wakeup() at probe, Bluetooth PME is intentionally off by default and follows sysfs wakeup policy.

Commit 2: wifi: apple: centauri: t6050: try full TLV 280 event mask on wake with legacy fallback (8ecf51d29987)

  • Keep the sleep command 6 TLV 280 at the existing 86-byte length (1 + 85, carrying the 9 filtered sleep events) on every firmware.
  • On wake, try the 91-event full mask (CEN_HOST_EVENTS_FULL) first and fall back to the 85-event legacy mask (CEN_HOST_EVENTS_LEGACY) on -EREMOTEIO while the Alpha transport remains healthy (exec == 2).
  • Log the refused firmware status once per Wi-Fi registration via dev_info() when fallback succeeds, without permanently latching the legacy count so a transient unrelated refusal does not pin a registration to 85 events.

Verification (host-side; bare-metal T6050 matrix pending)

  • scripts/checkpatch.pl --strict --git 4a17f737e9ca3..HEAD: 0 errors, 0 warnings, 0 checks on both commits.
  • Host test suites (--negative-controls):
    • tools/asahi/centauri-wifi-pm-tests.py: PASS (including centauri_t6050_wifi_mark_failed, legacy fallback + one-shot dev_info, transient refusal recovery back to 91 events, full-mask wake, sleep-uses-full-len and silent-fallback-log negative controls)
    • tools/asahi/centauri-bt-arena-tests.py: PASS (including Beta fallback ACIPC unwind + missing-quiesce-acipc-wake negative control)
    • tools/asahi/centauri-recovery-tests.py: PASS (including post-fence fn1/fn2 state_saved refresh, unreadable-function clearing, negative-stale-state-saved and negative-save-unreadable-fn negative controls)
    • tools/asahi/centauri-physical-recovery-tests.py: PASS
  • arm64 LLVM=1 W=1 (asahi profile): btcentauri_t6050.o, centauri_pci.o, centauri_wifi.o compile cleanly with 0 warnings.
  • Bare-metal T6050 hardware validation matrix (pending on default cmdline, K116s + M5 Max):
    1. Associated, WoWLAN off -> rtcwake -m mem (warm-reset fallback, reported reset).
    2. Associated, iw phy wowlan enable any + wake on traffic (keep-alive).
    3. Not associated, WoWLAN off -> rtcwake -m mem (keep-alive with PME off on all 3 functions).
    4. Forced keep-alive fallback with Bluetooth kept alive first, verifying fn 2 does not regain Bus Master after an aborted suspend.
    5. Bluetooth up across sleep.
    6. One firmware where the 91-event wake falls back to 85 (confirming one-shot dev_info with refused status and healthy post-refusal state) and one where 91 succeeds directly.

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown

Review at b11ae16.

  1. centauri_wifi.c:2179-2192: the TLV 280 size probe latches max_host_events on the first command 6 that succeeds. That is always the sleep call (2261), and the sleep TLV carries 9 events (events[0] = ARRAY_SIZE(sleep_events)) padded out to 1 + event_count bytes (2170). So the probe only checks whether firmware accepts a 92-byte TLV, not a 91-event mask. If firmware accepts the longer sleep TLV but rejects 91 events on wake, the wake call fails with -EREMOTEIO, there is no fallback because max_host_events is already set, and resume goes to recovery. Run the probe on the wake form only, or send the sleep TLV at its real length (1 + 9). The sleep TLV also changes from 86 to 92 bytes on every firmware, which the description does not mention.
  2. centauri_wifi.c:2138-2139: where do 91 events, and the claim that 27.2 has more events than 27.0, come from? Please cite a capture or trace in the commit message. As written, the numbers are unexplained. The macro names CEN_HOST_EVENTS_27_0/27_2 read like a firmware-version table even though the code chooses by firmware refusal. Name them for what they are (full mask vs. legacy mask).
  3. The TLV 280 change is unrelated to the associated rtcwake reset this PR fixes. Please split it into its own commit so it can be tested and reverted on its own.
  4. centauri_pci.c:1136: with WoWLAN off (the default), every sleep while associated now skips keep-alive and takes the warm-reset path. That is probably right as a fix, but the commit message should say that keep-alive only applies to WoWLAN-armed or unassociated sleeps now.
  5. btcentauri_t6050.c:1172: Beta PME now needs device_may_wakeup(). The driver never calls device_init_wakeup(), and the PCI core leaves wakeup disabled, so on a default system Bluetooth PME is now off where it used to be on. If this is intended (it does follow sysfs policy), say so and confirm that BT HID wake from s2idle still behaves as expected at default settings. Otherwise enable wakeup at probe.
  6. centauri_pci.c:1174-1179: the unwind ignores the return values of ipc_control_sleep(c, false) and wifi_resume(). If either fails, centauri_t6050_quiesce() runs against a sleeping Control/Alpha. At minimum log the failure. Better, mark recovery needed.
  7. Testing: no hardware rows at this head. Needed on T6050 (M5 Pro K116s and M5 Max): short rtcwake -m mem cycles while associated with WoWLAN off (the reported reset), the same with iw phy wowlan enable any plus wake on traffic, a forced keep-alive fallback, and Bluetooth up across sleep. Please also run at least one firmware where the 91-event probe falls back (27.0), and one where it does not (27.2), showing which mask was used (dyndbg).

@DjDeveloperr
DjDeveloperr force-pushed the fix/centauri-t6050-sleep-hardening branch from b11ae16 to 1fe0a90 Compare November 23, 2026 00:20
@DjDeveloperr

Copy link
Copy Markdown
Author

@RyanTheTide Thanks for the thorough review — pushed R2 (87505df2cd07 + 1fe0a90ab229) addressing items 1–6 plus an additional cross-function state_saved hazard caught during the audit:

  1. TLV 280 wake-only probe (1fe0a90ab229): Sleep (asleep = true) now always sends the existing legacy 86-byte TLV 280 (1 + 85, carrying the 9 filtered sleep events) on every firmware without latching wifi->max_host_events. Only wake (asleep = false) probes 91 -> 85 on -EREMOTEIO (while exec == 2) and latches the accepted mask, with unit tests and a latch-on-sleep negative control in centauri-wifi-pm-tests.py.
  2. Event counts & naming (1fe0a90ab229): Renamed to CEN_HOST_EVENTS_LEGACY (85) and CEN_HOST_EVENTS_FULL (91), citing drivers/net/wireless/apple/centauri/centauri_wifi.c / commit 4cca392085a9 (macOS 27.2 26B123 uses 91 events; older Alpha 48ef6696 rejects TLV 280 lengths >= 87 and event counts >= 86).
  3. Commit split: Split cleanly into two commits: fallback/PME/unwind/state_saved hardening (87505df2cd07) and wake-only TLV 280 probing (1fe0a90ab229).
  4. Keep-alive scope (87505df2cd07): Commit message and PR description now state explicitly that with WoWLAN off (default), sleeps while associated take the warm-reset path and keep-alive applies only to WoWLAN-armed or unassociated sleeps.
  5. Beta PME wakeup policy (87505df2cd07): Documented in the commit message that btcentauri_t6050 does not call device_init_wakeup() at probe, so Bluetooth PME is intentionally off by default and follows sysfs wakeup policy (confirming BT HID wake behavior from s2idle is included in the pending hardware test matrix). Also added the missing (__force u16) sparse casts for PCI_D3hot and PCI_D0 in btcentauri_t6050.c.
  6. Keep-alive unwind errors (87505df2cd07): centauri_t6050_suspend() now checks and logs return values from both centauri_t6050_ipc_control_sleep(c, false) and centauri_t6050_wifi_resume(c); on any unwind error it marks Wi-Fi failed via centauri_t6050_wifi_mark_failed() (so centauri_t6050_quiesce() skips ACIPC commands against sleeping firmware) and calls apple_centauri_sleep_recovery_needed(). centauri_t6050_wifi_suspend() checks its alpha_resume_locked() unwind similarly.
  • Bonus fix (87505df2cd07 — stale fn1/fn2 state_saved): Because cen_suspend() runs before centauri_t6050_suspend() and saves fn 2 PCI config while Bus Master and MSI are enabled in keep-alive mode, centauri_t6050_domain_fence() now refreshes pci_save_state() (or clears state_saved = false on error) for fn 1/2 once IRQs/MSI are freed and Bus Master is cleared. This prevents an aborted suspend after a Control fallback from restoring Bus Master/MSI onto a quiesced function whose IRQs and DMA arena were already freed (centauri-recovery-tests.py adds tests + negative-stale-state-saved).
  1. Hardware validation (pending): Both commits are checkpatch.pl --strict clean (0/0/0), pass all 4 Centauri host test suites (--negative-controls), and compile with 0 W=1 warnings on arm64 LLVM=1. Bare-metal T6050 rows (K116s + M5 Max: associated WoWLAN-off rtcwake -m mem, WoWLAN-any + wake on traffic, forced keep-alive fallback, BT up across sleep / s2idle HID check, and 27.0 fallback vs. 27.2 full-mask dyndbg + serial capture for the wifi: apple: centauri: t6050: keep N1 firmware, Bluetooth, and Wi-Fi alive across deep sleep #2718 watchdog root cause) are still pending before merge.

@RyanTheTide

Copy link
Copy Markdown

Re-review at 1fe0a90 (87505df + 1fe0a90). Thanks for the split and the fixes. Points 1, 3, 4 and 6 are met in the code. I ran the four host suites on this head (centauri-wifi-pm, centauri-bt-arena, centauri-recovery with --negative-controls, and centauri-physical-recovery): all pass. No chip or firmware-version gates, no module parameters, and the sign-offs are fine. What is left:

  1. t6050/centauri_pci.c:775-777: the state_saved refresh runs even when the function could not be read. centauri_t6050_stop_dma() (202-212) returns false when the PCI_COMMAND read fails or Bus Master still reads as set, which is what a function that is gone after a reset looks like (all-ones). pci_save_state() does not fail in that case: it stores the all-ones header and sets state_saved. centauri_t6050_rewake_teardown() (848) reaches the fence on exactly that kind of device, and a later pci_restore_state() would then write PCI_COMMAND = 0xffff, the opposite of what this hunk is for. Please refresh only when stop_dma() succeeded for that function and clear state_saved otherwise. The host test covers the save-fails case only (centauri-recovery-tests.py:199-206); an unreadable function would be the useful negative control.
  2. Same hunk: the state_saved = false branch is close to dead code, because pci_save_state() only fails on a missing capability save buffer. If it is ever taken during suspend, the PCI core's suspend_noirq saves the state itself and picks the power state for fn 2, after apple_pcie_t6050_sleep_reset() has already been requested (1216). That is acceptable, but say in the comment that the core takes over in that case. The commit message also says the stale state would restore "Bus Master and MSI"; pci_restore_state() restores MSI from the software state, which is already gone once the vectors are freed, so only Bus Master (and the rest of the header) is at stake.
  3. t6050/centauri_wifi.c:2202-2208 (review point 1): the wake-only probe is right, and the latch is per Wi-Fi registration (the struct is allocated in centauri_t6050_wifi_register() at 2730 and freed by every quiesce at centauri_pci.c:794), so a firmware reload or recovery starts the probe again. One gap: any firmware status on the first wake is treated as "91 is too long". A refusal for another reason followed by a successful retry latches 85 for as long as the registration lives, which with WoWLAN armed can be the whole uptime, and nothing in the log says so. Please log the firmware status once when the fallback is taken (dev_info, not dyndbg), and latch the legacy count only on the status the length refusal actually returns, or do not latch the legacy count at all (one refused command per wake is cheap).
  4. Review point 2: the rename is fine. The citation is not enough yet. 4cca392 states "85 events rather than 26B123's 91" in a code comment, but neither that commit nor this one says how the 91 was observed. Please name the capture it comes from (a command 6 payload seen on the wire or in a trace of the running system) in the commit message. If there is no such capture, drop the build number and describe only what the driver does: try the longer list, fall back when firmware refuses it.
  5. Review point 5, btcentauri_t6050.c:1167-1175: I checked this again and it is not the s2idle regression I asked about. The hunk only runs under pm_suspend_via_firmware(), so s2idle is untouched, and wifi: apple: centauri: t6050: keep N1 firmware, Bluetooth, and Wi-Fi alive across deep sleep #2718 says the host wake triggers are not programmed and that a wifibt wake is a dark wake, so no working wake-on-Bluetooth is lost. Default-off is fine for now. Two things remain. First, it changes the default keep-alive sequence: wifi: apple: centauri: t6050: keep N1 firmware, Bluetooth, and Wi-Fi alive across deep sleep #2718 was proven with all three functions in D3hot with PME_En set before PME_Turn_Off, and at default settings (WoWLAN off and not associated, Bluetooth wakeup disabled) all three now enter D3hot with PME off. That exact case needs a row (pass 4 of wifi: apple: centauri: t6050: keep N1 firmware, Bluetooth, and Wi-Fi alive across deep sleep #2718 again at this head, plus a not-associated sleep) showing the firmware still survives and wakes cleanly. Second, the block comment at centauri_pci.c:602-605 still says "enter D3hot with PME_En". When Bluetooth wake is implemented, it has to be enabled at probe (device_init_wakeup()), not left to a sysfs toggle.
  6. Review point 6 is met (centauri_pci.c:1184-1207, centauri_wifi.c:2296-2301, btcentauri_t6050.c:833-845). A nit: recovery is scheduled at 1206 and the function then continues into the normal quiesce and warm-reset sleep, which queues the rewake on resume anyway. It is harmless (the owner deduplicates), but a comment that it covers the aborted-suspend case would help.
  7. Rows are still pending, as you say. Needed before merge, on the default cmdline, on K116s and the M5 Max: associated with WoWLAN off (the reported reset); wowlan enable any with wake on traffic; not associated with WoWLAN off (keep-alive, PME off, point 5); a forced keep-alive fallback with Bluetooth kept alive first, showing fn 2 does not get Bus Master back after an aborted suspend; Bluetooth up across sleep; one firmware where the 91-event wake falls back and one where it does not, with the mask that was used and proof that the firmware is healthy after the refused command. The host-tests check was still running when I looked.

Assisted-by: LLM (Claude:Opus 5.5)

…E gating

Harden the T6050 N1 keep-alive deep-sleep path on associated disconnects,
partial keep-alive fallback unwinds, post-quiesce PCI saved state, and
D3hot PME gating:

- Drain in-flight data_tx_busy[] completions during wifi_disconnect(),
  and skip keep-alive in favor of the existing warm-reset teardown when
  cfg80211_leave_all() just disconnected inside wiphy_suspend()
  (centauri_t6050_wifi_pm_disconnected()). With WoWLAN off (the default),
  sleeps while associated now take the warm-reset path; keep-alive
  applies only to WoWLAN-armed or unassociated sleeps.
- Unwind partial keep-alive ACIPC host-sleep cleanly before falling back
  to teardown: centauri_t6050_suspend() wakes Control and Alpha and logs
  any unwind failure, marking Wi-Fi failed with
  centauri_t6050_wifi_mark_failed() and scheduling recovery with
  apple_centauri_sleep_recovery_needed() (also covering aborted suspends
  where resume/rewake may not run) so centauri_t6050_quiesce() does not
  issue ACIPC commands against sleeping firmware;
  centauri_t6050_wifi_suspend() checks alpha_resume_locked() similarly;
  and cen_quiesce() wakes Beta ACIPC (clearing running if wake fails)
  before hci_unregister_dev().
- Refresh pci_save_state() for fn 1/2 in centauri_t6050_domain_fence()
  only when centauri_t6050_stop_dma() succeeded for that function, and
  clear state_saved otherwise (or if pci_save_state() fails, handing
  suspend_noirq state save and power-state selection back to the PCI
  core). Because cen_suspend() runs before centauri_t6050_suspend() and
  saves fn 2 PCI config while Bus Master is enabled in keep-alive mode,
  an aborted suspend after a Control fallback would otherwise restore Bus
  Master and the pre-quiesce header onto a quiesced function whose DMA
  arena was already freed, while calling pci_save_state() on a gone or
  unreadable function would snapshot 0xffff.
- Gate PCI_PM_CTRL_PME_ENABLE in D3hot on actual wake arming
  (centauri_t6050_wifi_wowlan_armed() for fn 0/1, device_may_wakeup() &&
  running for fn 2), update the stale D3hot PME_En overview comment, and
  add missing (__force u16) casts for PCI_D3hot and PCI_D0 in
  btcentauri_t6050.c. Because btcentauri_t6050 does not call
  device_init_wakeup() at probe, Bluetooth PME is intentionally off by
  default and follows sysfs wakeup policy.

Extend tools/asahi/centauri-{wifi-pm,bt-arena,recovery}-tests.py and
centauri-physical-recovery-tests.c to cover disconnect TX drain,
PM disconnect/WoWLAN/mark-failed helpers, Beta fallback ACIPC unwind,
and post-fence fn 1/2 state_saved refresh/unreadable-function clearing
with negative controls.

Signed-off-by: Diljit Singh <hey@djdev.me>
…h legacy fallback

Command 6 TLV 280 currently hardcodes the 85-event legacy mask on wake
so older Alpha firmware (which rejects TLV 280 lengths >= 87 and event
counts >= 86) accepts the command, leaving newer firmware that supports
91 events without its upper event slots restored after sleep.

Keep the sleep command 6 TLV 280 at the existing 86-byte length
(1 + 85, carrying the 9 filtered sleep events) on every firmware. On
wake, try the 91-event full mask first and fall back to the 85-event
legacy mask on -EREMOTEIO while the Alpha transport remains healthy
(exec stage == 2). Log the refused firmware status once per Wi-Fi
registration via dev_info() when fallback succeeds, without permanently
latching the legacy count so a transient unrelated refusal does not pin
a registration to 85 events.

Extend tools/asahi/centauri-wifi-pm-tests.py to cover legacy fallback
with one-shot dev_info logging, transient wake refusal recovery back to
91 events, full-mask wake acceptance, and sleep-length/fallback-log
negative controls.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the fix/centauri-t6050-sleep-hardening branch from 1fe0a90 to 8ecf51d Compare November 23, 2026 00:44
@DjDeveloperr

Copy link
Copy Markdown
Author

@RyanTheTide Thanks for the detailed re-review — pushed R3 (6fb60db5532e + 8ecf51d29987) addressing all 6 points:

  1. Unreadable function guard in centauri_t6050_domain_fence() (6fb60db5532e, centauri_pci.c:766-785): Now calls pci_save_state(fn[i]) only when centauri_t6050_stop_dma(fn[i]) succeeded for that function (fn_stopped), and clears fn[i]->state_saved = false otherwise so a gone/all-ones device never gets 0xffff saved. Added the unreadable-function test and negative-save-unreadable-fn negative control in tools/asahi/centauri-recovery-tests.py.
  2. Comment & commit message accuracy (6fb60db5532e): Updated the centauri_t6050_domain_fence() comment to note that clearing state_saved hands suspend_noirq state save and power-state selection back to the PCI core, and fixed the commit message to refer to Bus Master and the pre-quiesce header rather than MSI.
  3. Wake TLV 280 fallback logging & no legacy latch (8ecf51d29987, centauri_wifi.c:2192-2214): Dropped permanent legacy latching so a transient unrelated -EREMOTEIO cannot pin a registration to 85 events; on -EREMOTEIO while exec == 2, wake retries 85 events and logs the refused status once per Wi-Fi registration via dev_info() ("Alpha host wake fell back from 91 to 85 events (status=%u)"). Added unit tests for legacy one-shot logging, transient refusal recovering back to 91 on the next wake, full-mask wake, and sleep-uses-full-len / silent-fallback-log negative controls in centauri-wifi-pm-tests.py.
  4. Provenance (8ecf51d29987): Dropped the uncited 26B123 build-number claim from the commit message and described strictly the driver's wake try-91 / fall-back-to-85 behavior.
  5. D3hot PME comment & default-off test row (6fb60db5532e, centauri_pci.c:602-605): Updated the stale "enter D3hot with PME_En" overview comment to reflect wake-armed PME gating, and added the unassociated WoWLAN-off (keep-alive with PME off on all 3 functions) row to the pending T6050 hardware validation matrix in the PR description.
  6. Unwind recovery comment (6fb60db5532e, centauri_pci.c:1209-1212): Added a brief comment noting apple_centauri_sleep_recovery_needed() covers the aborted-suspend path where resume/rewake may not run.

Verified at 8ecf51d29987: scripts/checkpatch.pl --strict --git 4a17f737e9ca3..HEAD (0/0/0 on both commits), all 4 Centauri host test suites with --negative-controls PASS, and arm64 LLVM=1 W=1 (asahi profile) builds btcentauri_t6050.o, centauri_pci.o, and centauri_wifi.o with 0 warnings. Bare-metal T6050 rows (point 7, including the unassociated PME-off row) remain pending before merge.

@RyanTheTide

Copy link
Copy Markdown

Re-checked at 8ecf51d (6fb60db + 8ecf51d). All six are addressed:

  • centauri_t6050_domain_fence() saves state only for a function whose stop_dma() succeeded and clears state_saved otherwise (centauri_pci.c:780-782), so an unreadable function can no longer snapshot 0xffff. There's a negative control for it now.
  • Wake tries 91 events every time and retries 85 only on -EREMOTEIO with exec == 2, with a one-time dev_info carrying the refused status. A transient refusal no longer pins the registration, at the cost of one refused command per wake on the older firmware, which is fine.
  • The build-number claim is gone from the commit message, and the comments and commit message are corrected.
  • The unassociated, WoWLAN-off, PME-off keep-alive case is in the hardware matrix.

No code concerns left from my side. Before merge it needs the T6050 rows from the matrix on the default cmdline (K116s and M5 Max), including one boot where the wake falls back (showing the log line and healthy firmware afterwards) and one where it doesn't.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Author

Bare-metal T6050 default-cmdline sleep matrix verified on Apple MacBook Pro 14-inch M5 Pro (J714s / T6050 Centauri N1) running 7.3.0-m5-n1keep-r3 (exact head 8ecf51d299877dbcb6b7d543a1f41a1290689442):

  • Cmdline (default, deep sleep [deep]): root=PARTUUID=af556966-b708-45da-a433-58f8c8128703 rw rootwait console=tty0 console=ttyDC0 earlycon=dockchannel,0x288e3c000 loglevel=7 nokaslr panic=0 pd_ignore_unused clk_ignore_unused systemd.mask=m5-expert-workspace-build.service systemd.mask=aurora-centauri.service appledrm.show_notch=1 idle=nop arm64.nowfxt
  • Firmware (/lib/firmware/apple/centauri/j714s-ftab.bin): sha256: 4684ef989f464ac4721e9319f3aeacb3c80b9dfa4a3945e0948329020e27e8d1 (31,239,788 bytes)
  • TLV 280 wake mask result on this firmware: Alpha host wake fell back from 91 to 85 events did not trigger on either keep-alive wake (t2 or t3) — the 91-event full wake mask (CEN_HOST_EVENTS_FULL) succeeded directly with 0 N1 keep-alive wake failed, 0 N1 keep-alive suspend failed, and 0 Control ACIPC / Alpha host wake errors.
Test Mode Sleep / Wake Path Result Post-wake Health
T1 Associated, WoWLAN OFF (rtcwake -m mem -s 30) Commit 1 warm-reset fallback (port 0: endpoint warm reset replayed before sleep, link up 280 ms) suspend_rc=0, elapsed_s=36, MBSE 0x10650 wifi_ready=yes, 4/4 pings (0% loss)
T2 Associated, WoWLAN ON (iw phy phy1 wowlan enable any, 90s guard) N1 keep-alive (no warm reset, no PCIe re-probe, link up 115 ms) suspend_rc=0, elapsed_s=97 (guard alarm; 12 host pings during sleep got Destination Host Unreachable and did not wake early), MBSE 0x10650 wifi_ready=yes, 4/4 pings (0% loss), 0 keep-alive errors
T3 Unassociated, WoWLAN OFF (rtcwake -m mem -s 30) N1 keep-alive (PME off) (no warm reset, no PCIe re-probe, link up 117 ms, no spurious early wake) suspend_rc=0, elapsed_s=37, MBSE 0x10650 wifi_reassoc=yes, 4/4 pings (0% loss), 0 keep-alive errors
T4 BT hci0 (powered br/edr) UP across sleep (Wi-Fi associated, WoWLAN OFF, rtcwake -m mem -s 30) Warm-reset fallback (port 0: endpoint warm reset replayed before sleep, link up 283 ms), fn0/1/2 re-enumerated suspend_rc=0, elapsed_s=37, MBSE 0x10650 wlp1s0f0 connected cleanly; hci0 (FC:B2:14:B7:35:82) re-registered cleanly ~10 s post-wake (unpowered br/edr default after re-probe, after the script's 3 s snapshot)

@axboe

axboe commented Nov 23, 2026

Copy link
Copy Markdown

K116s (16-inch M5 Pro, firmware 27.2) rows at 8ecf51d. The reset from #2718 is gone.

Kernel: integration/aurora bb9f8ec plus my K116s stack (#2187, #2201 v6, #2309, the old #2191 head 016a839) plus the two commits here. The driver hunks are identical to this head; one conflict in centauri_t6050_set_d3hot() (my base predates the __force cast) and I kept my copy of centauri-wifi-pm-tests.py, so no host test result from this tree. Default cmdline, WoWLAN disabled, Bluetooth off. No dynamic debug in my config, so the driver's debug prints are compiled in with -DDEBUG instead. One boot, four sleeps in a row:

Sleep Wi-Fi at entry Path Result
raw rtcwake -m mem -s 30 associated warm reset, N1 enumerated again resumed, reassociated, 4/4 pings
raw rtcwake -m mem -s 30 associated warm reset resumed, reassociated, 4/4 pings
raw rtcwake -m mem -s 30 after nmcli device disconnect down keep-alive resumed, reconnected, 4/4 pings
35 s RTC alarm, systemctl suspend down (NetworkManager) keep-alive resumed, reassociated, 4/4 pings

The first two are the case that reset 2 of 2 before. I also ran those two plus the logind one on your first head b11ae16 earlier today, same result.

The wake takes the full mask on this firmware, no fallback line:

Alpha firmware host sleep (connected=0 state=3 events=9 tlv280=86): ret=0 status=0 exec=2
N1 kept alive for firmware sleep
N1 noirq wake: fn0=0x1901106b(cmd=0x406 pm=0x8 exec=2 ipc=2) fn1=0x1902106b(cmd=0x406 pm=0x8 msi=1)
Alpha firmware host awake (connected=0 state=0 events=91 tlv280=92): ret=0 status=0 exec=2
N1 resumed alive after firmware sleep

Not run here: WoWLAN armed with a wake on traffic, Bluetooth up across a sleep, a forced keep-alive failure, and a firmware where the wake falls back. No serial capture either, but nothing failed that would need one.

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