Skip to content

wifi: apple: centauri: Quiesce Alpha for sleep on every N1 board - #2385

Draft
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
spec-m5neo/t8142-air-parity-n1
Draft

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
spec-m5neo/t8142-air-parity-n1

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

centauri_wifi_suspend() and centauri_wifi_resume() (drivers/net/wireless/apple/centauri/centauri_wifi.c:2713,2726) only run on apple,j813. The host-power and ACIPC sleep requests they send are the N1 firmware's protocol. J815 has the same N1 behind the same PCI functions and its own entry in the driver's board table (4cca392, "wifi: apple: centauri: quiesce Alpha for J813 system sleep").

Change

  • Suspend runs on any board where the native driver bound (c->wifi set, which needs a centauri_board() entry). It stays behind the existing TEST-ONLY apple_centauri.alpha_sleep_untested switch.
  • Resume drops its board check: it only undoes requests that suspend sent (alpha_resume_locked() returns at once when none were sent).

Testing

  • Compiled centauri_wifi.c before and after with the release config's kbuild command line and W=1, as a module: no compiler warnings on either side.
  • Default behaviour (switch off) is identical on every board: suspend returns before doing anything, and resume finds nothing to undo. With the switch on, J815 and J873g (T8152) now also send the handshake.

Still to run

  • @m0d16l14n1 (J815): with apple_centauri.alpha_sleep_untested=1, Wi-Fi disconnected, one s2idle and one deep cycle. Expected: no "Alpha transport remains paused" error, Wi-Fi scans after resume.
  • @sithglan (J813): the same row. Expected: unchanged.
  • J873g owners: the same row if you can, or tell me if T8152's N1 needs a different sequence and I will key it on that.
Details
  • btcentauri.c (Bluetooth side, the same pattern) is handled in a separate change.
  • Credit: the sleep handshake is sithglan's (4cca392).

Assisted-by: LLM (Claude:Opus 5.5)

The Alpha host-power and ACIPC sleep requests are the N1 firmware's
protocol, but suspend and resume only ran them on apple,j813. J815 has
the same N1 behind the same PCI functions and its own entry in the
driver's board table.

Run suspend wherever the native driver bound (c->wifi is set, which
needs a board entry), still behind the TEST ONLY alpha_sleep_untested
switch, and drop resume's board check: it only undoes requests suspend
sent and returns at once otherwise. With the switch off nothing changes
on any board.

Fixes: 4cca392 ("wifi: apple: centauri: quiesce Alpha for J813 system sleep")
Suggested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@gig3m

gig3m commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5), macOS 27.2 stub, apple_centauri.alpha_sleep_untested=1. No change from before. Wi-Fi was still connected, not disconnected as the row asks.

Two deep cycles with a 30 s alarm: each one logged the full handshake, and there was no Alpha transport remains paused:

TEST: Alpha firmware host LPNA: ret=0 status=0 exec=2
TEST: Alpha ACIPC host sleep: ret=0 status=3 exec=2 ipc=2
TEST: Alpha ACIPC host wake: ret=0 status=0 exec=2 ipc=2
TEST: Alpha firmware host awake: ret=0 status=0 exec=2

After each wake, the interface kept its addresses and pinged the gateway (3/3), and Bluetooth stayed powered.

s2idle: not run.

🤖 Generated with Claude Code

@sithglan

Copy link
Copy Markdown
Contributor

A J813 data point for this series. #2385 does not cause it, but it shows how the handshake it widens can fail.

Default J813 boot (integration/aurora with #2135 and #2142, apple_centauri.alpha_sleep_untested=1), 2026-11-19:

  • 10:43:03: lid closed, deep sleep committed, woke about 3 s later on an SMC wake (a USB-C plug change). Wi-Fi re-associated at 10:43:10.
  • The lid was still closed, so logind suspended again at 10:43:34. LPNA returned 0 at exec=2, then the ACIPC host-sleep write was never acknowledged:
    Alpha ACIPC host sleep: ret=-5 status=0 exec=3 ipc=2
    
    The Alpha firmware aborted (stage 2 -> 3) during the handshake. Three earlier cycles in the same boot had passed the same sequence.
  • The restore in centauri_wifi_suspend() cannot wake a firmware at exec 3, because the transport check requires exec 2:
    Alpha transport remains paused after refused sleep: -5
    
    transport_paused stays set, so every later suspend returns -EBUSY and every scan fails (rc=-16, data ring setup -5) until reboot. logind retried every 30 s until the lid opened, and each retry was refused.

So one failed handshake costs Wi-Fi until reboot, not just that one sleep. This doesn't block #2385, which stays behind the TEST-ONLY switch. But a J815 or J873g row that passes two cycles does not rule this out; a wake followed by an immediate second suspend (lid closed, cable change) is the case that hit it here. The fix belongs in the driver: recover an Alpha at exec 3, or at least clear the pause so it can be restarted. That is separate from this PR.

@sithglan

Copy link
Copy Markdown
Contributor

J873g: I can't run this row yet. The J873g's kernel configs (the integration-based PR stack and the private desktop one) build without CONFIG_SUSPEND, so there's no /sys/power/mem_sleep, and system sleep hasn't been brought up on the J873g at all. The board also describes no RTC for an alarm wake.

So there's no T8152-specific sequence to key on yet. Today's J873g kernel binds the same N1 functions as the J813: Wi-Fi reaches interface started, and Bluetooth paired with a J813 for #2330. With the switch off, this change does nothing on the J873g, as you describe. Once the J873g has suspend, I'll run this row there.

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