Skip to content

thunderbolt: apple: enable the J613 USB4 host-to-host path - #1490

Draft
satchlj wants to merge 10 commits into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j613-usb4-first-link-20261110
Draft

satchlj wants to merge 10 commits into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j613-usb4-first-link-20261110

Conversation

@satchlj

@satchlj satchlj commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

GPT-6.1 Sol on @satchlj's behalf

Enable the J613 (M3 MacBook Air, T8122) host-to-host USB4 path: T6030-generation MxWrap RUN/pre-RTKit LSTX policy, strict firmware-ready admission, explicit power ownership and witnessed four-domain off boundary, PD/NHI/PHY shutdown coordination, and saved-ADT PCIe-C resources with disjoint MSI slices. Failed power-off quarantines restart. Seven logical commits add the binding description, provider witness, MSI validation, router/session policy, DT resources and production-function host regression. A final commit shares named ECAM/MSI constants and the aperture selector with negative host tests.

Draft: final-head build/KUnit and clean schema validation remain incomplete. This series publishes the pieces exercised in today's trial for review now. It is rebased directly onto current integration/aurora dc8f6f7, not a personal stack. Today's running kernel was the retained Trial 2 source, not this exact rebased head. Additional restrictions scope match data/session coordination and dynamic tunnel containers to J613; these restrictions themselves have not been booted. Sleep coordination carried from the trial remains unqualified and must be reviewed or split before merge; it is not a suspend-support claim.

Dependencies and attribution:

Board Hardware result (November 10 trial, not this rebased head)
J613 / T8122, M3 MacBook Air First link on both ports at 40 Gb/s against an M4 Mac mini running macOS; XDomain, thunderbolt-net, ping both ways. Single-stream iperf, MTU 1500, 10 seconds: 15.08 Gb/s out and 3.21 Gb/s in on left-front; 15.41 Gb/s out on left-back. One clean replug; no-cable regression gate passed.
Other boards Not hardware tested by this work.

No sleep testing, including sleep with a link. Storage/dock/DP tunnels, the USB2/USB3 tour, three-cycle repeated replug and orientation flip were not tested. DP tunnels remain disabled on J613. A separate left-back DP alt-mode Dell test reached 3840x2160@60; this is not a DP tunnel test. Throughput is below macOS and under investigation; no tuning or parity claim.

Scope and no-cable behavior:

The T8122 match selects this policy only on apple,j613; other T8122 boards keep their old fallback policy. The new root tunnel containers and aliases are included only by J613 and are populated dynamically after cable-triggered router start, not as ordinary /soc devices. No powered-off wrapper reads are added at probe. Other boards retain their old shutdown/PM behavior; the provider helper has no autonomous consumer. The no-cable gate passed in the hardware trial, not yet on this rebase. Deleting J613's disabled unused OTG node prevents older loader pruning from disabling its active ATC0 PHY/DARTs.

Validation and outstanding merge gates:

  • All seven T8122 DT profiles compile with clang preprocessor + dtc, including J613/J615 firmware variants.
  • Production PMGR witness host fixture passes: missing/foreign domain, regmap error, and every status bit independently injected; masks come from the driver source.
  • All seven formatted commits pass checkpatch with --ignore FILE_PATH_CHANGES (0 errors/0 warnings); range diff whitespace check passes.
  • Stock dtschema 2026.9 validation of both selected J613 DTBs fails with KeyError: 'uint8-array' on apple,tunable, reproducing the retained kit limitation. This used the retained processed integration schemas; only the ACIO description text changes here. This is not a clean dtbs_check pass. Binding gaps and the decoder exception remain to close on fresh final-head schemas.
  • The retained hardware Trial 2 built Image/modules/all DTBs with LLVM18/Rust1.85; warnings remained. That is historical evidence only. A new full final-head Image/modules/dtbs build and KUnit execution have not completed: alba's shared build VM initially had only 3.7 GiB free. Space has since recovered to about 27 GiB, but its global build lock remains held by another job after bounded retries. No competing heavy build or alteration of another task's build tree was made. The lock was subsequently acquired normally and the isolated two-worker build is running; a sequential final-head rebuild, touched-schema check and QEMU Thunderbolt/DP lifecycle KUnit runner follow under the same lock. These remain draft merge gates, not passed checks.

Provenance: register windows, IRQs, MSI window and tuning tuples came from the saved J613 ADT, rechecked against current firmware ADT in today's trial. RUN/pre-RTKit LSTX was inferred from the matching T6030 generation/layout, not learned from a J613 macOS ACIO restart trace. Hardware firmware-ready/link and real domain-off witnesses support that candidate, but do not establish Apple's restart/SRAM protocol. No guessed M5 SRAM writes, secure-monitor handoff, copied Apple source, firmware or private trace dumps are included.

Excluded: untested no-RUN parameter and verbose trial-only register diagnostics, RTC/ALS/CPU/SoC sleep and unrelated display changes, DP tunnel enablement, throughput tuning. Human DCO identity is Satya Benson; Assisted-by: LLM follows Documentation/process/coding-assistants.rst, as in #1486 . Prepared with Codex (GPT-6.1 Sol) from the retained local J613 implementation.

Modular production build and legacy-tree qualification

The modular J613 config (USB4=m, USB4_APPLE_SOC=m) exposed an undefined
tb_apple_sleep_quiesce at modpost. The published GPL export fixes that linkage;
strict checkpatch and the full LLVM18 Image/modules/DTBs build pass.

The all-live-head 30.11 exact-binary J613 trial passed rendering, camera, no-finger
SEP start/stop, memory-floor and all-core IPC checks. It is not promoted:
both CIO probes fail because the installed Stage 2 handoff DT has only rc,sram
resources, whereas this driver requires the named cpu MxWrap resource. The
probe returns EINVAL before mapping or powering it. Current Linux DTS has the
resource, but a kernel DTB install does not replace the Stage 2 handoff tree.
30.9 remains the working default; no Stage 1/2 write was made. A legacy-tree
adapter or a later attended DT-bundle update needs separate review before
shipping this live head to that installation.

Describe the existing four-range format used by the T8122 router.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Read target, actual, busy and automatic state after release. Do not
override shared votes; let the caller quarantine restart when power-off
is unproven.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Keep the two J613 ECAM windows in disjoint 32-vector slices of the ADT
AIC window.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Use RUN with explicit pre-RTKit LSTX and strict firmware readiness;
disable DP tunnelling. Own power references and require a witnessed off
boundary before restart. Order PD, NHI and role/PHY shutdown. Keep the
T8122 session coordinator scoped to J613. The sequence was inferred from
the T6030 generation, not a J613 macOS restart trace, then exercised on
J613 hardware. Suspend coordination is carried from the trial but is not
hardware qualified; sleep remains outside admission.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Use saved J613 ADT windows, interrupts and tuning. Populate the root
tunnel containers dynamically and include them only on J613. Own all
four ACIO domains. Drop the disabled unused OTG node whose shared
PHY/DARTs older Stage 2 loaders otherwise prune. Both J613 firmware
profiles inherit the repair.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
Compile the production function with missing and foreign domains, regmap
errors and each status bit independently injected. Extract provider
masks rather than duplicating register constants.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
satchlj and others added 3 commits November 10, 2026 16:29
Use one aperture selector for PCIe-C admission and its negative tests.
Reject unknown apertures rather than borrowing another bridge slice.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
The Apple NHI driver calls tb_apple_sleep_quiesce() from the Thunderbolt
core. With CONFIG_USB4=m and CONFIG_USB4_APPLE_SOC=m, these are separate
modules and modpost rejects thunderbolt_apple.ko with an undefined symbol.

Export the existing helper to GPL modules so the modular configuration
links. No quiesce behavior or hardware register access changes.

Validated with the J613 production configuration, LLVM 18 Image/modules/
DTBs build and modpost, plus strict checkpatch.

Assisted-by: LLM
Signed-off-by: Satya Benson <satya@benson.earth>
Preserve original contributor commits and newer integration changes. Resolve only the overlapping shared-driver conditions/fields, retaining both the PR safety gates and the newer main behavior. Hardware qualification holds remain unchanged.

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

Resolved the current integration overlap mechanically and preserved original commits: apple_cio_hw keeps both newer dpin_count and strict_power_cycle. Existing PMGR witness/MSI-selector host tests and changed-Python syntax passed; broad CI reruns on this immutable head. This remains draft. The installed legacy Stage2 handoff still lacks the named cpu/MxWrap resource required by the new policy; a reviewed compatibility adapter or separately authorized attended DT-bundle path is still needed before kernel-only rollout there. Do not bypass the resource or power/reset admission checks. Current-head both-port/orientation/replug/no-cable/USB2-3/sleep and modular linkage/schema gates remain. Ref sent to ryan-orch-regress for other-generation regressions after CI; this does not prove the new J613 USB4 path.

Both targeted retries failed before validation in Ubuntu apt DNS bootstrap.
Use Ubuntu's signed HTTPS archive/security mirror list on the ephemeral
runner and fail apt update on repository errors. Keep test/toolchain,
permissions, job limits and driver/DT source unchanged.

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

Both targeted retries failed before validation again: host job130612271185 and DT job130607022936 hit apt DNS failures resolving azure.archive.ubuntu.com, exit100. Neither is a driver regression or a successful test/schema result.

Appended CI-only9b89ce27, preserving contributor history: host/DT runner mirror lists use Ubuntu's HTTPS archive/security endpoints and apt update fails on repository errors. The two workflows are byte-identical to the validated bootstrap fix prepared for973; YAML/bash syntax checks pass. Test/toolchain/permissions/job-limit and all production driver/DT source remain unchanged. Fresh hosted CI must validate the actual bootstrap and source checks; no blind third retry of the old jobs.

Draft status and the named-cpu legacy Stage2 handoff incompatibility, final-head/module/KUnit/schema and physical link/replug/sleep gates remain unchanged. No Stage1/2 installation or new M3 hardware test was performed.

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The direct-mirror bootstrap trial now has a result: DT job130632869563 executed the new archive/security list and strict apt update, but both Ubuntu hostnames still failed DNS. It stopped with exit100 before installing tools or running any DT/schema validation. The mirror substitution did not solve the runner issue; this is not a DT failure or a green validation result.

Preserved the full log and shared the result with the lab coordinator. No further unchanged retry or speculative driver/resolver change is being made. Existing exact-ref offline build/check summaries can be reviewed as separate evidence when available; no new hardware/build is requested here. Draft, named-cpu legacy handoff compatibility, actual validation and physical qualification gates remain open.

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

Current host and DT workflows now pass on9b89ce27, including actual DT/schema validation after the earlier dependency-DNS failures. This closes those hosted checks; the prior failed bootstrap attempt is retained history and needs no replay.

Keep draft/unmerged. The installed J613 Stage2 handoff still lacks the named cpu/MxWrap resource, and the driver correctly refuses before mapping/powering it. Green host/DT checks do not qualify that installation or the final link/replug/no-cable/sleep behavior. The modular-build statement and other older trial results retain the exact source/composition limits in the description; no new current-head kernel/KUnit/hardware result is asserted here.

I notified Ryan that the existing Neo/J700 and M4 Pro/J616s shared-regression queue may pass its CI wait, within its previously owner-approved one-shot/default-restoration scope and their own candidate build/admission checks. Those other-generation regressions cannot qualify the new J613 USB4 path. No new M3 test, loader/DT-bundle installation, hardware access or reset/admission bypass was requested.

@satchlj

satchlj commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Claude Fable 5.2 on @satchlj's behalf

Hardware results for this draft's current head 9b89ce2742e2f43abf70dc9d6331d5211406cc9e (fetched fresh before and after the run; it did not move), with the Stage 2 loader from aura #153 at 182d13e0ab0e8fea7d88b8f29d21a559c6525fc5 (now merged).

Setup. MacBook Air M3 (J613), kernel 7.3.0-aurora73-exact-1111-tb-ARCH (the open-PR composition plus this PR's full merge-base-to-head delta), booted once through a one-shot trial Stage 2 built from aura 182d13e0; the installed loader was not changed. Peer: Mac mini Mac16,10 running macOS, one Thunderbolt cable. Owner present for cables.

Boot. Trial handoff verified; both CIO nodes bound to thunderbolt-apple-acio (701ac0000.cio, b01ac0000.cio); no router objects with no cable. No kernel warnings or oopses in the whole session.

Both ports passed.

left-front (b01ac0000) left-back (701ac0000)
Link 2 x 20 Gb/s rx and tx 2 x 20 Gb/s rx and tx
Retimer 0x5ac:0x2200 found found
XDomain host Apple Inc. Mac16,10 same
thunderbolt0 ping, Linux→macOS 5/5, ~0.35 ms 5/5, ~0.24 ms
ping, macOS→Linux 5/5, ~0.31 ms 5/5, ~0.32 ms
Unplug 5 s / replug Gen2/3 link error 84/87/89, retimer and host disconnected, re-link and host rediscovered ~12 s after replug with no action on the Linux side; ping 5/5 both ways same (errors 83/87), ping 5/5 both ways

attach health generation N lane 1/2: 0 state 0x4824003c activity 3 after each attach.

Not run / limits.

  • No suspend test: this pairing was not built for it (the trial loader lacks the installed RTC-alarm wiring).
  • No throughput measurement, only ping.
  • No Linux-to-Linux peer this time (the second machine was busy); that pairing was last run this morning on e1644365.
  • This kernel refuses the native display handoff on this loader (J613/25G83 display handoff refused: -22; keeping boot framebuffer), so the session ran on the boot framebuffer with no external display; that is a property of the trial loader pairing rather than of this PR, but it means Thunderbolt and native display were not exercised together.
  • One userspace unit failed during the session (macsmc-battery-charge-control-end-threshold, start-limit-hit); not investigated, and it does not fail on the default kernel.

@RyanTheTide

RyanTheTide commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Shared-board regression on J700 (T8140), unattended. This says nothing about J613 function.

Trial kernel: integration/aurora 716670b + local merge of 9b89ce2 (merge 839af615), same config as the 716670b baseline. The J700 and J616s DTBs it builds are identical to the baseline's, and the J700 boots its loader-supplied DTB unchanged.
Baseline: the same 716670b kernel, one-shot, run twice. Trial run twice in one boot.

Row Baseline (2 runs) Trial (2 runs) Result
Internal panel eDP-1 connected, 2408x1506 same pass
External DP-1 (USB-C to DP monitor) connected, 1920x1080, EDID 256 B same pass
GPU (G17P), glmark2-es2 800x600 2781, 2674 2684, 2877 pass (within run-to-run spread)
USB one controller, USB2 480M + USB3 10000M, 11 devices at 12M/480M/5000M/10000M same devices and speeds pass
Type-C port0 device/no partner, port1 host/partner same pass
DPMS on -> off (both outputs) On -> Off On -> Off pass
DPMS with replug not run (needs a person) not run NOT RUN
s2idle, 2 cycles (15 s RTC wake) 2/2, both displays and all USB back, network back in 7 s / 1 s 2/2, same, network back in 11 s / 1 s pass
DCP crashes / DART faults / CIO errors 0 / 0 / 0 0 / 0 / 0 pass
New DRM/DCP errors during the rows 0 0 pass
Failed units / SELinux AVC 0 / 0 0 / 0 pass

One thing to watch: in one of the two trial runs, DP-1's sysfs EDID read 0 bytes while the output was in DPMS off. The connector stayed connected with its mode and was still connected after both suspend cycles. Neither baseline run showed it, and two runs can't tell a regression from the monitor going to sleep.

J700 has no CIO/USB4 domain, so the CIO row only checks that no errors appear. J616s rows are still pending (that Mac is offline).

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The new current-feature-head J613 report6805776917 closes the two-port link/XDomain/ping, one unplug/replug per port and no-cable observations for its stated combined kernel plus one-shot aura153@182d13e0 trial. Both CIO nodes bound, so the named-CPU/MxWrap handoff was usable in that trial. This supersedes the earlier claim that no current-feature-head J613 link result existed. The installed legacy loader remains unchanged; the trial does not qualify a kernel-only upgrade on its old handoff tree.

Keep draft. J613 suspend was not exercised, and the description’s carried sleep coordination still needs its pre-merge review/qualification or separation. The trial rejected native display handoff and used the boot framebuffer, so it does not establish simultaneous Thunderbolt/native-display operation. The battery-threshold unit’s start-limit failure is unresolved; do not call the entire userspace session clean. No current throughput, Linux-to-Linux, repeated three-cycle/orientation or USB2/3-tour result is claimed.

Ryan’s separate6806457668 J700 comparison closes its stated shared-board display/GPU/USB/DPMS/two-RTC-cycle rows against baseline716670b9 with local merge839af615. It does not test a CIO domain or J613 behavior; the isolated off-state EDID observation is not diagnosed. J616s remains pending/offline.

Current host/DT checks still pass. No source, loader/default, hardware or new M3 test action was performed or requested by this review; the remaining gates have been narrowed to the evidence above.

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