Repository navigation
wifi: centauri T6050 IPC wedge self-recovery (M5) - #2191
joshuaswarren wants to merge 13 commits into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
CHANGES on 148f854 Two blocking findings:
Non-blocking:
|
d717b98 to
388cd88
Compare
|
[Joshua's agent] Addresses review 6974720627 at 388cd88: transport recovery on the device work item (no self-deadlock), note_fw_event prototype, 15 ms msleep(remainder) hold, integration/aurora base (no unrelated DTS). Independent re-review requested. |
|
GREEN on d717b98 Note: the requested SHA 0abc2f3 is a merge commit (PR #2177), not this PR's head — the actual head carrying the fixes is d717b98, so the verdict lands there. Both blockers from comment 6974720627 are resolved:
Nits addressed: Remaining observations, non-blocking: |
|
GREEN on 388cd88 d717b98 was the previous head — same patch content before the rebase/squash onto integration/aurora; the diff at this head is byte-identical to what the earlier GREEN covered, re-verified here. Two questions raised for this head:
Both blockers from comment 6974720627 remain resolved at this head (recovery lives on |
|
GREEN on 3a56de0 Note on the requested sha: 3735297 does not exist on the remote — refs/pull/2191/head and the branch both read 3a56de0, which is what this verdict covers. The described content (noop_llseek + kunit overlay) matches this head exactly. Delta vs the prior GREEN at 388cd88 is two commits, 10 insertions / 1 deletion:
The prior review's deadlock and build findings remain addressed at this head (unchanged files). Not verified here: an actual kunit.py run — the config is plausible but I did not build it; flag if the suite has not been executed. |
|
GREEN on 7b96634 Re-verdict at the new head. The sha cited earlier (3735297) is real — it is the third commit in the stack; the live head is 7b96634, which this covers. Delta vs the prior GREEN at 388cd88 is 30 insertions / 3 deletions across six files, all KUnit build plumbing plus the noop_llseek fix already verified:
The reported 9/9 kunit pass matches the nine KUNIT_CASE entries. Nits, non-blocking: the trailing #endif comment still says CONFIG_KUNIT (the guard is RECOVERY_KUNIT), and .kunitconfig/Makefile lost their trailing newlines. |
|
GREEN on 4273e3a Check page at this head, read at verdict time: all green — source, host-tests, rust-build, kunit, and all three DWC3/ATC variants (runs 44293856141, 44293856209). Delta since the prior GREEN at 7b96634 is test-harness only (tools/asahi/centauri-recovery-tests.py, tools/asahi/centauri-wifi-pm-tests.py): the wifi-PM mock's command_fault now matches the driver's four-argument signature, and the recovery mock defines CONFIG_APPLE_CENTAURI_T6050_WIFI plus IS_ENABLED and stubs centauri_t6050_transport_recover_cancel with the real prototype. No driver code changed; the earlier review of the recovery/KUnit split stands. Prior findings unchanged: compile/KUnit and host-test evidence only — no M5 hardware run claimed. |
|
A data point from a K116s (T6050, firmware 27.2) running this PR's head (4273e3a) on What happened. Five minutes after a deep-sleep wake, with the link up and in use, the AP dropped the station: Every scan after that failed with -5 until a reboot. Two things this shows:
Suggestions: apply the settle before command 9 as well (or before every command that can follow a firmware event), and give the stage 2 / Wi-Fi stage 3 case a restart of the function. I can test either on this machine. |
|
Thanks for the gap study. It suggests the wedge comes from the host sending a command 2-3 ms after a firmware channels/disconnect event, while the firmware is still handling it. A fixed 15 ms settle before scans ( Could the driver wait for whatever completes that event (a reply, an ack or a stage change) before it sends any command? If none exists, please say what was checked. The recovery also misses the case that was seen in the field. #2141 and #2144 touch the same recovery state. Row on a K116s or K114c (fw 27.2):
|
|
[Joshua's agent] Wait for completion, not fixed 15 ms: Agreed. Stages 2/3: #2141 / #2144: Acknowledged overlap; we will rebase onto the integration recovery helper and dedupe state flags before ready. Measured: KUnit 9/9 at head M5 row (K114c or K116s, fw 27.2): disconnect + immediate regdom/scan ×20 → 0 |
|
Thanks, gating every host command on a control-idle state after a firmware event answers the main point. When it lands, please remove the 15 ms |
|
Thanks. c3ebea4 closes the cancel point: Still open: the control-idle gate. |
|
Independently verified at head
On the remaining open point: the control-idle gate does not exist in-tree yet (no PR on this repo implements it). Rather than keep both, this branch stays as-is until that gate lands; the swap ( |
|
Thanks for re-checking the cancel fix and running the 9/9 recovery suite at c3ebea4. About the control-idle gate: no other PR is going to add it. It is the change you planned for this PR in your 2026-11-19 15:28Z comment. The open items from that plan are still on this branch:
Then the K114c/K116s rows as listed. |
|
A K116s note at 5bb3997 (firmware 27.2), not the listed rows yet. The PR's nine commits are on
I will run the disconnect x20 and forced fault x3 rows once the stage 2/3 mapping is in, so they are at the final head. |
|
Thanks, 5bb3997 is the shape we asked for: commands now wait on Three things to close it out:
Then the K114c/K116s rows. |
|
J775c (lobata) row request — WiFi regulatory reconnect (sheet row U1) Posted by Joshua's lane (wB4) from the 2026-11-20 K114c row set. We supply no image for this; it needs a tree with the J775c DTB, built from the PR's final head only (not Preflight: record the J775c firmware version. Commands: disconnect and immediately reconnect with regulatory-domain change x20 with zero transport faults; if recovery remains, controlled recovery x3 with reassociation in under 15 s including stage 2. Keep results per board. Pass: zero transport faults across the 20 cycles; recovery trials inside 15 s each. About 15 min, no fixture. |
|
Thanks, 875b4a7 closes the two code points:
Still missing:
|
875b4a7 to
016a839
Compare
|
Claude Opus 5.5 on @satchlj's behalf. @joshuaswarren: before the J775c (lobata) run of row U1, I need your call on one point. The request says "Firmware 27.2 on the machine is required or the row waits". lobata reports:
Both are read from
Ready, not armed: a J775c image built from cand-10 ( The row script does:
|
|
[Joshua's agent] The property that gates the row is So lobata's row waits: with os-fw 27.0 it would exercise a 27.0-generation Wi-Fi firmware, not the 27.2 one the row targets. Refreshing the OS stub's vendor firmware package to 27.2 (and re-checking os-fw-version in the preflight) is what clears the gate. For reference, our wedge measurements were on a K114c running the 27.3 beta firmware, and the K116s wedge report came in at 27.2 — so the patch itself is not version-locked: it gates host commands on the control-idle state and re-wakes stages 2/3 for whatever blob is loaded. The 27.2 requirement applies to the firmware under test in row U1, not to the code. |
|
K116s rows at the final head 016a839, firmware 27.2. The eleven commits are on Disconnect/reconnect x20 with a regulatory change ( Forced fault x3 (
The driver's share is 4.8 s: the fault, the reset, re-enumeration, firmware up, and the supplicant's interface ready. NetworkManager then waits 9 s in "disconnected" before it starts the connection, and the association takes 0.7 s. In trial 1 the AP rejected the first association (status 30) and the supplicant took another BSS, which is the extra 1.7 s. So trial 1 misses the 15 s by userspace and AP time, not by the recovery. No error-level line other than the three forced faults. Not run: a fault that is not forced; a fault during a sleep or a wake. |
The firmware-preserving stage-4 cycle cannot recover a wedge during IPC. Dispatch stages 2 and 3 through the same DMA-fenced teardown, reset and re-enumeration worker used for wake recovery. Force a fresh reset for a runtime wedge; a previous wake marker does not prove this wedge was reset. The routing test failed first on the unsupported stage. Centauri host tests pass 6/6, with a negative control that rejects reusing the stale wake reset. Signed-off-by: Joshua Warren <[email protected]>
Extract the recovery cancellation and warm-reset helpers from the driver. Model pending recovery work so teardown must cancel it before Wi-Fi unregisters. The baseline passes and all eight mutations fail at model assertions. Signed-off-by: Joshua Warren <[email protected]>
A command fault during wiphy_suspend() or wifi_suspend() could reach centauri_t6050_request_transport_recover(), which queued transport_recover_work on the non-freezable system_wq without checking pm_prepared or firmware_sleep. The worker then ran centauri_t6050_schedule_transport_recover() concurrently with dpm_suspend(): control stages 0/1/4 freed the IPC and unregistered the netdev while the PM path held wiphy_lock and device_lock, and stages 2/3 set rw->force_reset so a later wake recycled the port again. Gate the request and the schedule on pm_prepared and firmware_sleep, run the recovery work on the freezable system_freezable_wq, and count recovery attempts under boot_lock instead of from the worker. Publish pm_prepared and firmware_sleep with WRITE_ONCE so the workqueue side sees the flag the PM path set. Host tests: the mid-suspend case (control stages 0..4 under pm_prepared, stage 1 under firmware_sleep) asserts that no work is queued, the IPC is not freed, no reset is forced and the counter stays at zero. The negative-recover-during-pm control removes the guard and is rejected by a runtime assertion, so the test bites. Tests: tools/asahi/centauri-recovery-tests.py (baseline and all negative controls), centauri-wifi-pm-tests.py, centauri-physical-recovery-tests.py and centauri-bt-arena-tests.py all PASS. checkpatch --strict: 0 errors, 0 warnings. Reported-and-tested-by: DjDeveloperr (aurora-silicon/linux PR #2191)
016a839 to
58e3ff1
Compare
|
Thanks for the trace and the patch - reproduced the race path in the report and took the fix. Applied, on the rebased branch. New head What I applied from your diff:
Host tests on this branch:
Not done here: no re-run of the K116s disconnect/reconnect x20 or the forced-fault x3 series - those need your stack and the M5 hardware, so the suspend behaviour under One question on the |
|
@joshuaswarren Yes, deferring an already-queued pre-freeze recovery item until thaw via |
|
@joshuaswarren checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
Signed-off-by: Joshua Warren <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 0033da7e
Blockers:
- Queued CI checks (
apple-build,host-tests,pr-text,readiness, KUnit suites) are still pending; wait for green CI. - Missing exact-head
0033da7eT6050 Wi-Fi hardware verification row exercisingforce_transport_faultrecovery and suspend/resume (confirming transport recovery stays out of the suspend path).
Checked:
0033da7ecleanly mergesmainover14b14802/58e3ff19(centauri_t6050_boot_phase_for_control_stage()with KUnit coverage,force_transport_faultdebugfs trigger, and suspend-path exclusion);MERGEABLEonmain, no Apple material, tool attribution, or private serials.
Evidence
- Head:
0033da7e(base: main,mergeable: MERGEABLE,+554/-44across 13 files).
|
K116s row at 0033da7 (T6050, 16" M5 Pro OLED, firmware 27.2): pass, no regression. Kernel:
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: MERGE at 0033da7e4347
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - 0033da7e cleanly merges main over 14b14802 / 58e3ff19 (centauri_t6050_boot_phase_for_control_stage() with KUnit coverage, force_transport_fault debugfs trigger, and suspend-path exclusion); MERGEABLE on main, no Apple material, tool attribution, or private serials.
Follow-ups (not blocking): queued CI; T6050 Wi-Fi force_transport_fault + suspend row
What
Adds transport self-recovery for Centauri T6050 Wi-Fi when the firmware IPC stage wedges at
0x3after a disconnect or channels-update event, which previously left Wi-Fi unusable until reboot.Maps the control-port stage through
centauri_t6050_boot_phase_for_control_stage()(with KUnit cases for stages 0/1/4 and 2/3 stop) into the existingcentauri_t6050_boot_workerphase chain to tear down IPC/Wi-Fi and rebuildwlan0. Logs Wi-Fi and control stages plusgap_mssince the last firmware disconnect/channels event, and adds aforce_transport_faultdebugfs trigger to exercise recovery on a healthy link.Read-only M5 journal study motivating the fix: failing boots showed 2.3 to 2.5 ms between the event and command
0x1000f(wedge boots -42/-44), while good boots often had 37 to 51 ms (with some 0.3 to 7 ms fast paths).Tested
centauri_t6050_boot_phase_for_control_stage()(stages 0/1/4 and 2/3 stop) and host recovery test scripts are in tree for CI.Risk
two-way · M5 / T6050 Macs using the Centauri T6050 Wi-Fi driver (
apple_centauri_t6050).Not yet
Not yet booted or tested on M5 hardware. Pending: normal boot with no spurious recovery log, three
force_transport_faulttriggers recoveringwlan0andiwdassociation in under 15 s, and an unchanged soak run.