Skip to content

soc: apple: rtkit: wait up to 10 s for a handshake reply - #1082

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/rtkit-handshake-10s
Nov 8, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/rtkit-handshake-10s

Conversation

@rolotrealanis98

Copy link
Copy Markdown
Contributor

apple_rtkit_wait_for_completion() gives a co-processor 1 s to answer. On the J716s (MacBook Pro 16-inch, M5 Pro, T6050) the ANS firmware that iBoot hands over sometimes needs about 3 s to answer the power-state and endpoint-map handshake. With PR #936's nvme-apple that fails as "ANS did not boot" / "Reset failure status: -62" and there is no root device; a later rebind of the same firmware works.

This raises the timeout to 10 s. A firmware that answers in time is not slowed down; only a dead co-processor is reported later.

Tested on: J716s, in every payload since our round R3-J; most recently R3-SERIES and R3-S (2026-11-07, kernel built from this tree + the T6050 PRs): NVMe partitions at 0.37 s on every boot. drivers/soc/apple/rtkit.o builds clean with W=1 (LLVM, arm64) on integration/aurora 7aee01a.

Dependencies: none; applies on integration/aurora alone and on top of #942 (rtkit crash logs). Motivated by #936 (T6050 ANS).

Open questions:

  • Would you rather have this per co-processor (a timeout_ms in struct apple_rtkit_ops, or a DT property on the ANS, default 1000 ms) than global? Happy to rework it that way.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merge-train pre-review (11-08). It isn't on our merge list yet, so a maintainer decides. The change makes the RTKit handshake wait 10 s for every co-processor on every Mac. When a co-processor really is dead, each one then holds probe or resume for 10 s instead of 1 s. Could the longer wait apply only where it's needed, e.g. a per-device timeout from the ANS driver on T6050, or a retry on the first slow handshake, so other SoCs keep failing fast?

apple_rtkit_wait_for_completion() gives the co-processor 1 s to answer.
On the T6050 (J716s, MacBook Pro 16-inch M5 Pro) the ANS firmware that
iBoot hands over sometimes needs about 3 s to answer the power-state and
endpoint-map handshake. With 1 s, nvme-apple fails with "ANS did not
boot" / "Reset failure status: -62" and the root device never appears,
although a later rebind of the same firmware succeeds.

Make the handshake timeout a per-instance setting, set with
apple_rtkit_set_handshake_timeout() and defaulting to the current
1000 ms, and use it for every handshake wait, including the polled
apple,sync-syslog-ack path. nvme-apple asks for 10 s on the T6050 ANS
only, so a dead co-processor on any other SoC is still reported after
1 s, and a T6050 ANS that answers in time is not slowed down.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
Assisted-by: LLM Claude
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Thanks, agreed. v2 (0630fab) makes the handshake timeout per instance: apple_rtkit_set_handshake_timeout() defaults to the current 1000 ms and is used by every handshake wait, including the polled apple,sync-syslog-ack path.

nvme-apple asks for 10 s only on apple,t6050-nvme-ans2, so every other SoC still fails after 1 s. It checks the compatible rather than match data because the T6050 entry is in #936; once that lands the check can become a field in apple_nvme_t6050_hw.

Testing: v1 with the global 10 s ran on the J716s on every boot. v2 is compile-tested only for now (rtkit.o and apple.o, W=1, LLVM), and it goes on the J716s in the next daily build.

@RyanTheTide
RyanTheTide merged commit db35e3d into aurora-silicon:integration/aurora Nov 8, 2026
3 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Tested before merging, silent: one-shot test kernel 7.3.0-aurora-f4mtr3x/y = integration/aurora 36d9198 plus this PR, #1082, #1083, #1084, #1060 and the Touch ID series, all merged onto the current tip. It was booted once on each of the four fleet Macs (M2 J413, M1 Pro J316s, J616s M4 Pro, MacBook Neo J700), and our regression suite was compared with the fleet30 rows on the same Macs:

  • boot err-level lines and AVC: 0 on every Mac;
  • 12 suspend/resume cycles with speaker regrant;
  • Wi-Fi/BT reconnect, camera and display;
  • AVD decode bit-exact (fps within ±2%);
  • ANE runs and resumes.
    No regression came from these PRs.

For this PR in particular: every fleet Mac kept the 1000 ms default (only apple,t6050-nvme-ans2 gets 10 s), and RTKit timeout and error lines in dmesg were 0 on both the test boot and the default boot of every Mac.

Thank you, Rolando!

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.

2 participants