Skip to content

soc: apple: aop: take the setup-port boot only with a "setup" mailbox - #2556

Open
satchlj wants to merge 2 commits into
integration/aurorafrom
satchlj/aop-setup-port-by-dt-20261120
Open

satchlj wants to merge 2 commits into
integration/aurorafrom
satchlj/aop-setup-port-by-dt-20261120

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

soc: apple: aop: take the setup-port boot only when the device tree gives the AOP a mailbox named setup. The T8140, T8142 and T6050 configurations open that second mailbox. A device tree whose AOP lists only mbox now gets the boot without the setup port.

Selection: the AOP node's mbox-names property, not the SoC or the board. The configuration's setup_port still has to be true, and the property is the only other input.

Effect on the tip's device trees: every tip DT whose AOP uses one of those configurations describes a setup mailbox:

  • t8140.dtsi;
  • t8142-j813-audio.dtsi;
  • t6050-die0.dtsi.

For them nothing changes. The only DT that takes the other path is one that lists mbox alone, such as #2102's J775c board file.

Base: integration/aurora f0c51766e9c5 (rebased 2026-11-20 14:4xZ; #2088, #2101 and #2447 since c92ed8517b79 touch none of this PR's files).

Testing

J775c (Mac Studio, M5 Max, T6050), on lobata.

Kernel: cand-7, 324280cadc47 = integration/aurora d91db387c720 + 85 commits. d91db387c720 is now several merges behind this PR's base (#1568, #1889, #1534, #1881, #1899, #2011, #1956, #1957); none of them touch aop.rs. Booted 2026-11-20 12:12Z. A run on cand-8, built on this base, will follow.

  • cand-7 includes this commit, as a cherry-pick of the same patch, and arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102's J775c DT. The AOP there has mbox-names = "mbox" and no setup mailbox.
  • cand-7's 84 other commits are lobata's candidate composition. Only this commit touches aop.rs (git log d91db387c720..324280cadc47 -- drivers/soc/apple/aop.rs).
Kernel AOP DT Result
cand-7, with this PR mbox only apple_aop 290c00000.aop: RTKit: Initializing (protocol version 12); driver bound; not in devices_deferred; no AOP error line (all from one boot)
cand-4, 7400d465c320, the tip's code without this PR mbox only probe fails with -61; the setup mailbox is missing
cand-5, d2f8af83bf98, without this PR with #2542's setup mailbox setup port: boot incomplete (AP power on: false, endpoints: 0/0): ETIMEDOUT (-110)

On cand-7, macaudio also probes and prints driver can't assure safety on this model, disabling speakers. On cand-4 it was deferred on its CPU DAI. My inference is that the AOP came up far enough to register its audio DAI, but I haven't checked the AOP's endpoint list.

Untested:

  • any board that has a setup mailbox (T8140, T8142, other T6050 boards), where the code path is unchanged;
  • AOP services beyond RTKit start, and AOP sleep and wake.

Assisted-by: LLM (Codex:GPT-6.2)

The T8142 and T6050 configurations boot the AOP through a second
mailbox, named "setup", as well as the RTKit one. Take that boot only
when the device tree gives the AOP a mailbox of that name. A device tree
that lists only "mbox" gets the boot without the setup port, which is
the one the AOP takes where no setup mailbox is described.

Signed-off-by: Satya Benson <satya@benson.earth>
@RyanTheTide

Copy link
Copy Markdown
Contributor

The code change is clean: every use of the configuration's setup_port now goes through the per-device flag, and the paths that run without a setup queue already handle None.

My concern is what the property ends up meaning. The J775c's AOP does have the setup mailbox (#2542 described it, and with it the setup-port boot timed out with "AP power on: false, endpoints: 0/0"), so on that board the J775c DT leaves out a mailbox that exists in order to pick the other boot. That makes mbox-names a protocol switch: a T6050 DT that drops setup by mistake would boot the AOP without the setup port (and without ALS calibration) instead of failing at probe. The difference seems to be in what this AOP's firmware expects, so a selector the firmware or the boot data provides would fit better, for example what the AOP reports during the RTKit handshake. If the mailbox stays the selector, please say in the binding (apple,t8152-aop.yaml:39-49) that leaving out setup means the firmware doesn't use the setup-port boot, and keep the mailbox itself described.

Assisted-by: LLM (Claude:Opus 5.5)

Describe when the setup mailbox must be listed and what its omission
means for the firmware boot protocol.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf.

I checked the AOP probe and boot data handling, the RTKit HELLO decoder, and the history in #2542. HELLO exposes a version range, and #2542 reports protocol version 12 on both boot paths. The setup mailbox is also opened before the CPU starts, so the current handshake supplies no way to choose it at that point. The binding now says to list setup when the firmware uses the setup-port boot protocol and that omitting it selects boot over the primary RTKit mailbox alone. It still describes the setup mailbox. The targeted dt_binding_check passed. This revision is untested on hardware.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of e157d43: Blockers: 1.

Earlier point:

  • mbox-names acting as the boot-protocol selector: resolved as far as the documentation goes. The reply makes the case that the handshake has nothing to select on before the CPU starts, and Documentation/devicetree/bindings/soc/apple/apple,t8152-aop.yaml:45-48 now says that leaving out setup selects the boot over the primary mailbox alone. The setup mailbox is still described at :38-42.
  1. Commit f252206 ("soc: apple: aop: take the setup-port boot only with a "setup" mailbox") has no Signed-off-by and ends with a Co-Authored-By: Claude Opus 5.5 trailer. It needs the author's Signed-off-by and that trailer dropped.

Nit: the new binding text (apple,t8152-aop.yaml:46) says that listing setup selects the setup-port boot, but drivers/soc/apple/aop.rs:3290 also requires the configuration's setup_port, which is false for plain apple,t8152-aop (aop.rs:3146). A T8152 DT that lists setup is then ignored without a word. Either say so in the binding, or warn at probe when setup is listed and the configuration doesn't use it.

HW row: J775c at e157d43 with the mbox-only DT: AOP RTKit up, not in devices_deferred, no AOP error; and one T8140 or T8142 Mac with a setup mailbox showing the setup-port boot still completes; 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj
satchlj force-pushed the satchlj/aop-setup-port-by-dt-20261120 branch from e157d43 to e9fe5bb Compare November 21, 2026 21:12
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: trailer-only rewrite, removed Co-Authored-By from 1 commit(s); same trees, Signed-off-by kept (e157d43 -> e9fe5bb, --force-with-lease).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Checked e9fe5bb: the Co-Authored-By trailer is gone, but 85189d6 ("soc: apple: aop: take the setup-port boot only with a "setup" mailbox") now ends with no trailer at all, so it still has no Signed-off-by. Only the binding commit e9fe5bb carries one. It needs Signed-off-by: Satya Benson <satya@benson.earth> on 85189d6 too. That's the one remaining blocker from my last review (the binding nit about T8152 ignoring setup still stands, but isn't blocking).

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj
satchlj force-pushed the satchlj/aop-setup-port-by-dt-20261120 branch from e9fe5bb to 23f33fc Compare November 21, 2026 21:53
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: added the missing Signed-off-by: Satya Benson to 1 commit(s); same trees, nothing else changed (e9fe5bb -> 23f33fc, --force-with-lease).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Checked 23f33fc: both commits now carry your Signed-off-by and no tool trailers, and the code is unchanged (range-diff is commit-message only). The blocker is resolved. The binding nit about T8152 silently ignoring a listed setup is still open but non-blocking. The rows from my earlier review (J775c mbox-only AOP up; a T8140/T8142 with setup still taking the setup-port boot) are what's left before merge.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr 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.

Pre-PR checklist review at 23f33fc765c0: 0 code/policy/attribution/naming/CI blockers; holding only for §5 hardware evidence on the live head.

Code, Binding, Attribution, and CI Audit (§1–§4, §6)

  • Code (§1–§3): Clean. Checked every cfg.setup_port site in drivers/soc/apple/aop.rs — all three (AopData::new, setup_open, and the boot branch in probe()) now go through the per-device setup_port flag derived from cfg.setup_port and DT mbox-names containing "setup". All downstream paths (SetupPortCallback, source_ring(), remove(), start(), sleep_enter(), sleep_undo()) handle setup_queue == None safely.
  • In-tree DTs: Verified t8140.dtsi, t8142-j813-audio.dtsi, and t6050-die0.dtsi all list "setup" in mbox-names, so existing machines retain unchanged behavior.
  • Attribution (§4): Both commits (f34b611b138d, 23f33fc765c0) carry human author/committer identity and Signed-off-by: Satya Benson <satya@benson.earth> only, with zero AI trailers in commits.
  • CI: All 8 checks (dt-checks, host-tests, source, rust-build, kunit, and all three DWC3/ATC matrix jobs) are green.

Non-blocking Nit

  • Documentation/devicetree/bindings/soc/apple/apple,t8152-aop.yaml:46-48 states that including setup selects the setup-port boot, whereas HW_CFG_T8152 (drivers/soc/apple/aop.rs:3146) sets setup_port: false, so a plain apple,t8152-aop DT listing setup would have it silently ignored. Noting that in the binding or warning at probe when setup is listed with !cfg.setup_port would tighten that up.

Holding for §5 Hardware Evidence on 23f33fc765c0

  • J775c (mbox-only DT) booted on 23f33fc765c0 (the earlier cand-7 run was on an older base + 84 unrelated commits, and 23f33fc765c0 is noted untested): AOP RTKit up, not in devices_deferred, no AOP errors.
  • At least one Mac with a setup mailbox (T8140, T8142, or T6050) booted on 23f33fc765c0 confirming the setup-port boot path still completes cleanly.
  • Regression row for the run: 0 SELinux denials, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Gemini 4 Neon)

@funkzy

funkzy commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

J775D (M5 Ultra Mac Studio, T6050) row: the same result as the J775c.

  • Integration's T6050 tree (setup mailbox described): the setup-port boot times out (setup port: boot incomplete (AP power on: false, endpoints: 0/0), probe -110), and no sound card registers. Same on the 27.0 and 27.2 firmware.
  • This PR plus a J775D tree that lists only mbox: integration 24dc422 + this PR + that tree change, one-shot boot on the 27.2 firmware. The AOP binds over RTKit, its audio service gets its child device and driver, the AppleJ775D sound card registers, and there are no AOP error lines. The 2 failed units (iwd, networkd persistent storage) come from the test root, and none of the 4 err-level lines is from the AOP.

We'll send the J775D tree change as its own PR on top of this one.

Assisted-by: LLM (Claude:Opus 5.5)

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.

4 participants