Skip to content

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

Draft
RyanTheTide wants to merge 1 commit into
mainfrom
isw/t6050-centauri-failed-sleep-v2
Draft

RyanTheTide wants to merge 1 commit into
mainfrom
isw/t6050-centauri-failed-sleep-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #2271 (same changes, commit trailers fixed).

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: 0 errors, 0 warnings.
  • 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.

…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]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at e34e08f (non-author, draft). No blocker found; ready once a T6050 row is in.

  • Merges cleanly onto integration/aurora 6748d83. One commit, human sign-off only. wifi: apple: centauri: T6050: don't veto s2idle for a failed or stopped N1 #2271 is closed.
  • Only the no-firmware-sleep branch of centauri_t6050_suspend() changes. CEN_BOOT_ROM/CYCLE/IPC still return -EBUSY; READY, FAILED and STOPPED call pci_save_state().
  • The unlocked read is safe for this decision: boot_phase only moves forward under boot_lock (ROM -> CYCLE/IPC -> READY, or -> FAILED/STOPPED), and nothing moves a FAILED or STOPPED device back to an in-flight phase short of a new probe. A phase that turns FAILED right after the check only costs one refused sleep, as before.
  • With the driver saving the state itself, the PCI core leaves the power state alone for FAILED/STOPPED exactly as it does for READY. If the endpoint is unreachable after a stopped port cycle, the saved configuration is all-ones and pci_restore_state() on wake finds the same value and writes nothing.
  • The firmware-sleep path below is untouched.

Small points, not blocking:

  • READ_ONCE() on the reader without WRITE_ONCE() on the writers in centauri_t6050_boot_worker(): fine in practice, but either annotate both sides or take boot_lock for the read.
  • A boot that stays in CYCLE or IPC (the worker re-queues itself every 20 ms on -EAGAIN, with no bound that I can see) still refuses every s2idle. That is the same class of problem this change fixes for FAILED; worth a look while here, or a line in the message saying it is left.
  • Rows still open: the repro from the issue on a T6050 Mac (firmware file moved away, systemctl suspend, expect sleep and wake), plus one normal s2idle with Wi-Fi up, and a lid-close during the first seconds after boot to see the in-flight -EBUSY clear by itself.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Duplicate of #3356 (e89a04f, same change: a failed or stopped N1 no longer holds off s2idle). #3356 already has a non-author review and is waiting on its J714s row. Review and test that one, not this one. This draft closes with a link once #3356 merges.

This branch has not been deployed

No deployments
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