Skip to content

wifi: apple: centauri: T6050: don't veto s2idle for a failed or stopped N1 - #2271

Closed
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/t6050-centauri-failed-sleep
Closed

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/t6050-centauri-failed-sleep

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1380.

On a sleep that keeps the N1 powered (s2idle, no firmware sleep), centauri_t6050_suspend() returned -EBUSY for every boot phase but CEN_BOOT_READY. If the N1's automatic startup failed (CEN_BOOT_FAILED, for example a missing or bad firmware file) or the device was stopped (CEN_BOOT_STOPPED), nothing ever moves it to READY. Every s2idle and lid close was then refused until the driver was unbound.

Change. Only a boot in flight (CEN_BOOT_ROM, CEN_BOOT_CYCLE, CEN_BOOT_IPC) holds the sleep off. On this path a ready N1 only gets its config space saved, and the device stays powered. A failed or stopped N1 has no boot work in flight either, so it is handled the same way. The firmware-sleep path (apple_centauri_sleep_reboot()) is unchanged.

Evidence.

  • checkpatch --strict: no code findings (only the no-tree commit-id warning and the trailer form).
  • Build: compiles with the fleet release config on 0abc2f3: 0 warnings, 0 errors. In the disassembly of centauri_t6050_suspend(), the test is now phase >= READY -> pci_save_state() and phase < READY -> -16. Before, it was phase != READY -> -16.
  • Hardware: not run, as we have no T6050 machine. The repro from the issue: boot once with the N1 firmware file moved away so that dmesg shows N1 automatic startup failed, then run systemctl suspend. Before this change dmesg shows the suspend refused with -16 from the N1. With it the machine sleeps and wakes. A normal s2idle with Wi-Fi up should behave as before.

Reported by @RINNECODER in #1380, including the fix.

Assisted-by: LLM (Claude:Opus 5.5)

…ed N1

centauri_t6050_suspend() returns -EBUSY for every boot phase but READY
when the sleep keeps the N1 powered (no firmware sleep). If the N1's
automatic startup failed (CEN_BOOT_FAILED, for example a missing or bad
firmware file) or the device was stopped (CEN_BOOT_STOPPED), nothing will
ever move it to READY. Every s2idle is then refused, a lid close
included, until the driver is unbound.

Only a boot in flight (ROM, CYCLE, IPC) needs the sleep held off. On
this path a ready N1 only gets its config space saved; the device stays
powered through the sleep. A failed or stopped N1 has no boot work in
flight either, so treat it the same way and let the system sleep. The
firmware-sleep path is unchanged.

Fixes: f044e18 ("wifi/Bluetooth: apple: centauri T6050: the N1 over a firmware sleep")
Reported-by: RINNECODER <[email protected]>
Closes: #1380
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. Commit 1b916ce ends with Co-Authored-By: Claude Opus 5.5 <[email protected]>. Commits must carry human identity only. Drop that trailer and keep Signed-off-by and Reported-by. The Assisted-by: line in the PR body already covers it. Push the corrected commit on a new branch.

The logic is sound. Of the phases in centauri_t6050.h:32-37, only ROM, CYCLE and IPC are ones the boot worker is still driving (centauri_pci.c:460-490). The worker's -EAGAIN retry keeps the phase at CYCLE or IPC, so a requeued boot still holds the sleep off. FAILED and STOPPED are terminal until reprobe. On this path resume returns early when firmware_sleep is false (:1071) and prepare does nothing (:1001), so letting a FAILED or STOPPED N1 through only saves config space. That is no worse than what a READY N1, with firmware running, already does. READ_ONCE on the unlocked boot_phase read is right. integration/aurora still has the old != READY test (centauri_pci.c:1048), and GitHub reports this as mergeable on top of 1e56c6f.

HW row: J714s or K116s (any T6050) on this head.

  • (a) The repro from t6050 centauri: system suspend is refused while the N1 is FAILED or STOPPED #1380: boot with the N1 firmware file moved away (dmesg shows N1 automatic startup failed), run systemctl suspend, and the machine sleeps and wakes with no -16 from the N1.
  • (b) A normal boot with Wi-Fi associated: 5 s2idle cycles, and Wi-Fi passes traffic after each.
  • 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2795: the same changes with the commit trailers fixed, on the current integration/aurora.

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.

t6050 centauri: system suspend is refused while the N1 is FAILED or STOPPED

1 participant