Skip to content

wifi: apple: centauri: t6050: gate commands during host sleep - #3110

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/centauri-t6050-host-sleep-gate
Nov 25, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/centauri-t6050-host-sleep-gate

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Risk: two-way · M5 Pro / M5 Max (T6050 Centauri N1)

What:

Reject N1 Alpha commands while the host is asleep, before publishing a descriptor or touching the PCI BAR. A late cfg80211 regulatory callback could otherwise poll the BAR as the link entered D3hot.

Retain the latest named country and refresh the channel flags after a successful Alpha wake, including suspend unwind. A failed wake keeps the gate closed. Transport loss during replay enters the existing N1 recovery path.

Tested:

Head 588178f047698c70ae3b186f0b46fad5f6a9894a.

  • python3 tools/asahi/run-host-tests.py --only centauri with prebuilt host tools: 16/16 runs passed. The Wi-Fi PM harness rejected all 14 negative controls, including the four new controls.
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
Hardware Kernel and configuration Result
J714s, MacBook Pro M5 Pro (T6050) 7.3.0-m5-cengate2, native warm -j18 build of the head above, default cmdline, MTE on, SEP writes on apple_centauri_t6050 probed and held its Wi-Fi association through 2/2 deep mem sleeps with RTC0 wake and WoWLAN any armed. Both wakes passed vulkaninfo and gpubench-vk compute.light. 0 SErrors, panics, GPU faults or new kernel error signatures against prior J714s logs.

The late regulatory callback and replay failure are covered by the host negative controls. The J714s run restored the byte-identical ESP files and booted back into 7.3.0-m5-cdirect15, where both GPU checks passed again.

A cfg80211 regulatory callback can run after the Alpha host-sleep
command and poll the BAR while PCI is entering D3hot. Reject firmware
commands before touching the rings or BAR while host sleep is active.

Keep the latest named country while asleep and refresh the channel
flags once the Alpha wake succeeds. Use the same replay on suspend
unwind and keep the gate closed if the wake fails. Let the existing
resume recovery handle transport loss during replay.

Fixes: b8fce26 ("wifi: apple: centauri: t6050: keep N1 firmware and Wi-Fi alive across deep sleep")
Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 25, 2026 01:38
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 588178f0: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no approved by satchlj, but GitHub does not count it yet (code owner from Core or Omarchy Mac needed, or approval went stale)
Requested changes ok none
Hardware row at head no no line with the head SHA 588178f0, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M5 Pro / M5 Max (T6050 Centauri N1)

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini 4 Neon on @satchlj's behalf

Verdict at 588178f04769

APPROVE — Clean, well-tested fix gating N1 Alpha commands while the host is asleep (-EHOSTDOWN before sequence increment, descriptor publish, or BAR access), preserving deferred regulatory/country state across wake and suspend unwind under consistent rtnl_lock -> wifi->lock ordering, with all latest CI checks green.

Blockers

None.

Checked

  • Diff scope: 2 files changed (drivers/net/wireless/apple/centauri/t6050/centauri_wifi.c, tools/asahi/centauri-wifi-pm-tests.py, +167/-18), 1 commit (588178f04769) carrying Signed-off-by: Diljit Singh <[email protected]>.
  • Code & locking audit:
    • command_reply() returns -EHOSTDOWN when wifi->host_sleep_sent is set right after clearing *submitted = false, before incrementing wifi->sequence or touching ring indices/BAR MMIO.
    • Confirmed alpha_transport_state() uses direct BAR MMIO (bar + 0x1024) rather than command_reply(), so setting wifi->host_sleep_sent = true before alpha_transport_state(wifi, true) does not block the transport-sleep handshake.
    • Confirmed alpha_resume_locked() clears wifi->host_sleep_sent under wifi->lock for alpha_host_power(wifi, false) and restores wifi->host_sleep_sent = true on failure without dropping deferred regulatory state; on success, replays country_set() + channels_apply() and returns -EIO without unpausing TX/transport if wifi->command_failed latches.
    • Verified lock ordering (rtnl_lock -> wifi->lock) across wifi_regulatory(), centauri_t6050_wifi_suspend(), centauri_t6050_wifi_resume(), alpha_resume_locked() (ASSERT_RTNL() + lockdep_assert_held(&wifi->lock)), and centauri_pci.c callers (SYSTEM_SLEEP_PM_OPS .suspend/.resume, never noirq).
    • Verified tools/asahi/centauri-wifi-pm-tests.py adds test_host_sleep_gate(), test_deferred_regulatory(), and 4 corresponding negative controls.
  • CI checks (all latest green on 588178f04769):
    • Host tests/host-tests: SUCCESS
    • pr-readiness/readiness / readiness: SUCCESS
    • pr-text/pr-text / pr-text: SUCCESS (after adding Risk:)
  • Untested scope: No live T6050 deep-sleep / WoWLAN run was executed on hardware in this pass.
Evidence
  • Audited drivers/net/wireless/apple/centauri/t6050/centauri_wifi.c (command_reply, country_set, channels_apply, alpha_transport_state, alpha_host_power, alpha_resume_locked, centauri_t6050_wifi_suspend, centauri_t6050_wifi_resume, wifi_regulatory, centauri_t6050_wifi_unregister), centauri_pci.c PM ops, and tools/asahi/centauri-wifi-pm-tests.py.
  • Verified OPEN|false|MERGEABLE|588178f04769 and latest host-tests, pr-readiness, and pr-text all SUCCESS.

@DjDeveloperr
DjDeveloperr merged commit a977440 into main Nov 25, 2026
5 of 6 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/centauri-t6050-host-sleep-gate branch November 25, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants