Skip to content

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

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

satchlj wants to merge 19 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

Current DT-fix checkpoint: head 972cf33ed4d44015f13ebf80aadcdc6210454292, tree f42301219c6cd81a8d75c32a50208b7be0f05aab. Both hosted checks pass: 376/376 host runs, 137 baseline/head DTBs (rc=0), zero new warnings and ten removed (1450→1440). Still draft. The renamed J613 DTBs require the fallback carried by Aura #302, built, tested on affected hardware, and adopted in the paired Stage 2 before rollout. #273 carried the same production change and is superseded. Source publication alone does not clear this gate.

Hosted validation: both edited bindings pass, and ADT coverage has no regression. CI tested synthetic merge cc5debf6976c20af9788ef6fa3de58853f306b9b, tree 70e38ebe3b3da91bf1898d92e3a7c3a342def3dc, on base d5a8a254. Its DT/binding fix inputs match this head; it also includes newer CIO/display/GPU sources, so this is current-main composition evidence rather than an exact standalone-head kernel build. Existing warnings and coverage gaps remain.

The prior 4dfb8b44 host job passed, but DT comparison failed: both baseline/head built all 137 DTBs (rc=0), with 14 new warnings and two removed. The new diagnostics identify missing T8122 PCIe-C compatible/eight-window descriptions, ACIO post-init-providers, and six newly added underscore alias names.

This follow-up supplies the bindings and valid hyphenated names for those six aliases, retaining node targets and inherited legacy aliases. The binding keeps an explicit T8122 compatible pair and exact eight-resource layout. The remaining inherited alias diagnostic matches the existing baseline; it is not suppressed. The Aura companion preserves legacy-first lookup and supplies the missing hyphenated PCIe-C fallback. Do not combine these DTBs with an older incompatible loader.

Local validation: both J613 DTB variants compile; the edited binding documents and YAML pass validation, and targeted PCIe/ACIO checks emit no errors. Their remaining alias warning matches the baseline. Bad compatible and register-order controls are rejected without validator crashes. Every node/property remains identical after normalizing just the six alias keys; representative J604/J616s control DTBs are byte-identical. The real-FDT Aura replay reproduces the old lookup assertion before the fix, passes afterward, and rejects a compiled old-lookup control. Artifacts are retained. The shared Kbuild lock was held for manual DT compilation and released; no Image/modules build or hardware operation was performed.

Existing J613 sleep, installed-loader compatibility, native-display/USB4 and final qualification gates remain. The loader still needs affected-hardware qualification and adoption before rollout.

Historical maintenance checkpoint: head 4dfb8b44b5a3a6c73f24d615da5105b98bafcc9b, tree f457ceb02b38e07794e4ef2d574e212d0a714551. Fresh hosted CI is pending. Still draft; existing functional/compatibility/sleep gates remain open.

Normal merge of prior f38fa76a and current integration 2b1ee661 preserves both histories. The sole textual conflict was adjacent helper definitions in drivers/thunderbolt/apple.c: retain this series' strict power-down/refcount/off-witness helper and main's J714s diagnostic helpers unchanged. The diagnostic board guard still returns before register reads on J613; J613 off-state failures still quarantine restart. Main advanced during preparation with disjoint G17 object-fence/host-registry changes; they are included, with the tested USB4/PMGR/PCIe inputs unchanged. No force push.

Local validation: existing production PMGR witness and T8122 MSI selector pass; enabled header declarations compile and disabled helpers compile/run with -EOPNOTSUPP. Extracted helper coexistence passes 500 power-ownership/fault cases, diagnostic board gating, and three compiled runtime-negative controls. The helper bodies are byte-identical to their respective source parents. Python/YAML/whitespace checks pass; main's unrelated sources and MMU rollback are preserved. The mocked C fixture disables the inherited signedness warning and unused-function warnings for controls; repository flags and assertions are unchanged. No local full kernel/module/DT/schema/KUnit or hardware run was performed.

Previous host/DT and J613/J700 reports below retain their original head/composition scope. This update does not qualify installed legacy-loader trees, J613 sleep coordination or simultaneous native display/USB4.

Historical maintenance checkpoint (2026-11-13): head f38fa76afb2fae97bf3675275f7a31367f20cd06, tree 637d827d26d924fe07b9cbcf791bd05a1ef1528a. Both current-head hosted checks passed. Still draft; remaining functional qualification is pending.

Normal merge of prior head 9b89ce2742e2f43abf70dc9d6331d5211406cc9e with integration/aurora@3d015d3d4e7ef8a42fed75842c5a7978819ea39a; contributor commits are retained. The only textual conflict was the disabled-config PMGR header: the resolution keeps both this series' apple_pmgr_ps_verify_off() and main's apple_pmgr_ps_verify_state(), plus main's consumer_is_off() declarations/stubs. Other files merged cleanly.

The production PMGR witness and shared T8122 MSI-selector host tests pass. Enabled header declarations compile; disabled-config helpers compile and return -EOPNOTSUPP. Changed Python syntax and whitespace checks pass. The header-resolution checkpatch reports0 errors/warnings/checks; aggregated PR-delta checkpatch retains two DT patch-organization warnings and one existing DTS blank-line check. Hosted validation on this exact head passed: host run43485979168 completed319/319 registered runs; DT run43485979243 built137 DTBs for both baseline and head (make return0), with0 new warning lines,31 removed (402 baseline versus371 head), and passed its ADT coverage-delta check. This is a successful warning/coverage comparison, not a warning-free tree or a claim that all existing ADT gaps are closed. No full kernel/module link, separate KUnit execution or new hardware run was performed for this merge.

Earlier J613 both-port link/ping/replug and J700 regression reports retain their precise old-head/composition scope. The usable one-shot loader trial superseded the earlier lack of named-CPU evidence for that trial; installed legacy-loader/kernel-only compatibility is still distinct. J613 suspend coordination needs review/qualification or separation; simultaneous native display/USB4, repeated orientation/replug and other unqualified rows remain open. No hardware or Stage1/2/default change was requested by this branch maintenance.

Retained original series description and earlier validation history (prior to this maintenance merge)

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.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

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

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

Signed-off-by: Satya Benson <satya@benson.earth>
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>
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>
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>
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>
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.

Signed-off-by: Satya Benson <satya@benson.earth>
DjDeveloperr added a commit to satchlj/linux that referenced this pull request Nov 11, 2026
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.

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

@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 integration conflict in normal merge f38fa76 (parents9b89ce27 and3d015d3d; tree637d827d). The sole manual conflict was the disabled-config PMGR header: kept verify_off(), verify_state(), and main’s consumer_is_off() declarations/stubs. The other files merged cleanly; all18 PR-path modes and contributor history are preserved.

Production PMGR witness and T8122 MSI-selector host tests passed, along with enabled-header declaration compilation, disabled-header EOPNOTSUPP checks, Python syntax and whitespace. Header-resolution strict checkpatch0/0/0; aggregated PR delta has0 errors,2 DT patch-organization warnings and1 existing DTS blank-line check. No new full kernel/module-link, DT/schema, KUnit or hardware result is claimed. Fresh host43485979168 and DT43485979243 workflows are running on this head.

The fork update used Git transport with an exact old-head lease after both connector and direct API permissions were refused. Published commit parents/tree/header were read back: old9b89 remains first parent, so history is preserved. Keep draft and remaining compatibility/sleep/functional gates; earlier hardware reports retain their old source/composition scope.

@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 conflict as normal merge 4dfb8b4, parents f38fa76 / 2b1ee66, tree f457ceb02b38e07794e4ef2d574e212d0a714551. The conflict was two independent helper additions at one location: keep the J613 power-down ownership/off-witness function and main’s J714s diagnostics. Both helper bodies remain byte-identical to their respective source parents, with the diagnostic board guard and strict restart quarantine intact. The GPL sleep-quiesce export and latest main’s disjoint G17 changes remain.

Existing PMGR witness and shared T8122 MSI tests pass. Extracted helper coexistence passes 500 ownership/fault cases, board-gated diagnostic reads and three compiled runtime controls; dropping the off witness, owned-reference release or J714s guard compiles and fails its assertion. Enabled header declarations compile; disabled helpers compile/run with EOPNOTSUPP. Python/YAML/whitespace pass. One first local fixture compilation exposed main’s int/ARRAY_SIZE signedness warning; that warning and unused fixture functions are suppressed locally, without changing production source, repository CI flags or assertions. No compile failure was counted as a mutation kill.

Fresh hosted CI is pending. This remains draft for the existing J613 sleep coordination/review or separation, installed legacy-loader compatibility, simultaneous native display/USB4 and other unqualified functional/final-source gates. Prior J613/J700 evidence keeps its original composition scope. No local full kernel/module-link, DT/schema, KUnit, hardware, loader or default change 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 failed DT job executed both builds successfully (137 DTBs each, rc=0), then rejected 14 new schema warnings. This is not an infrastructure failure. Follow-up 972cf33 describes the T8122 PCIe-C compatible/eight-window layout and ACIO post-init providers, and gives the six new J613 USB4 aliases valid hyphenated names. Node targets, register values and inherited legacy aliases remain unchanged.

Both J613 variants compile locally. Targeted PCIe/ACIO validation is clean; their inherited alias warning exactly matches the existing baseline. Binding documents/YAML pass. Incorrect compatible and register-order controls are rejected. Full node/property comparison is identical after only the six alias-key normalizations; J604/J616s controls are byte-identical. No warning filter or CI policy was weakened. Fresh full hosted comparison remains required.

This creates an explicit paired-loader dependency: Aura #273 adds the missing legacy-first usb4-N-pcie fallback. Existing Aura main supports the corresponding ACIO/NHI/adapter spellings, but the PCIe lookup otherwise loses tunables. A real-FDT test failed against the old production lookup, passes with the fix, and kills the compiled old-lookup control. Independent consumer review found no separate PCIe-port alias consumer in the inspected Aura/U-Boot/kernel paths.

Keep both PRs draft: the affected-hardware test and loader build/package/adoption must precede rollout of these DTBs. Publishing Aura source alone is insufficient. Existing J613 sleep/compatibility/native-display+USB4 and other functional gates remain. No new hardware, loader/default write or full Image/modules/KUnit result is claimed.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Thanks for the rebase. dt-checks on 154721f is red because of this PR's own nodes, not the earlier false positive: the DART power-domain check reports 4 new findings.

t8122-j613       /usb4-pcie-tunnel-0/iommu@721008000 apple,t8122-dart okay: no power-domains (new)
t8122-j613       /usb4-pcie-tunnel-1/iommu@b21008000 apple,t8122-dart okay: no power-domains (new)
t8122-j613-25g83 /usb4-pcie-tunnel-0/iommu@721008000 ... (new)
t8122-j613-25g83 /usb4-pcie-tunnel-1/iommu@b21008000 ... (new)

The two PCIe-tunnel DARTs added in t8122-usb4.dtsi need a power-domains entry pointing at the PMGR domain that powers each tunnel. That's normally the same ACIO/PCIe domain the matching usb4-pcie-tunnel-N controller uses, as on the other SoCs' usb4 dtsi files. Once they have it, the check goes green. Leaving this for when you take it out of draft.

@RyanTheTide

Copy link
Copy Markdown
Contributor

apple_cio_probe() in thunderbolt/apple.c replaces the T8122 match data with apple_cio_t8103_hw unless the machine is apple,j613. cd321x_ready() and tipd_shutdown() in tipd/core.c register the session notifier and the shutdown stop only on J613, and apple_msi_init() in pcie-apple.c picks the T8122 AIC base from the SoC compatible. These should follow the device nodes: the CIO compatible's match data, a property on the tipd node for USB4 session handling, and the PCIe node's match data or msi-ranges for the AIC base. A board that is not ready yet should simply not have those nodes enabled. Until then this should stay a draft.

Some USB4 routers must be stopped by the Type-C port driver, in a fixed
order ahead of the USB role and the PHY, before tasks freeze and at
shutdown. Others stop on their own. Let the provider say which it is in
its switch description, and give port drivers
typec_thunderbolt_switch_pd_ordered_stop() to ask, so they no longer have
to guess from the machine they run on.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8122 router policy (MxWrap RUN, explicit LSTX, strict firmware-ready
admission, witnessed power-off) was only taken on apple,j613. Every other
T8122 Mac with the same router - the 15-inch MacBook Air (J615), the
iMacs (J433/J434) and the MacBook Pro (J504) - fell back to the T8103
policy, which cannot start it.

What the policy needs is the router's MxWrap CPU block, which the device
tree names as the "cpu" resource. Take the T8122 policy whenever that
resource is described and keep the T8103 fallback otherwise (for example
an older loader's handoff tree without it).

The strict power cycle has to be stopped by the PD driver ahead of the
USB role and the PHY, so advertise that through the switch description
instead of letting the PD driver infer it from the machine.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The CD321x session stop before tasks freeze and at shutdown (ACIO, then
the USB role, then the PHY in safe mode) only ran on apple,j613. Run it
for whichever port's USB4/Thunderbolt switch asks for a port-driver stop
instead, and leave every other switch alone as before. The notifier is
registered for every CD321x and asks the switch on each suspend, because
the router may bind after the port.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Agreed on all three. Each one needs its own change and a J613 USB4 row:

  • apple_cio_probe(): give the T8122 CIO compatible its own match data, so the apple,j613 override goes.
  • tipd: a property on the tipd node selects the USB4 session notifier and the shutdown stop, instead of the J613 check.
  • apple_msi_init(): the PCIe node's match data or msi-ranges gives the AIC base, instead of the SoC compatible.

None of this is done tonight. The J613 deep-sleep work has the rig, and the DART power-domains commit for the two PCIe-tunnel DARTs (DjDeveloperr's dt-checks finding) is still queued ahead of it. This stays a draft until the gates follow the device nodes and that row has run.

Cover the suspend notifier with a router that stops on its own (nothing
is sent to it) and with one that asks the port to stop it (SLEEP before
the freeze, WAKE after it).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
pd_ordered_stop asks the Type-C port driver to stop the USB4 session
before tasks freeze and at shutdown. Only the SPMI SN201202x driver had a
.shutdown, so on the T8122 Macs whose CD321x sits on I2C (J433, J434,
J504) the router took the strict power cycle at device_shutdown with the
USB role and PHY still owned by the port.

Give the I2C driver the same .shutdown. The I2C driver also binds plain
TPS6598x parts, which have no struct cd321x around them, so
tipd_shutdown() now returns early for a port whose variant does not
embed one, and a KUnit case covers that.

On a PREPARE that fails, the PM core skips our POST_SUSPEND: clear
session_pm_armed on that path too so the state stays obvious.

Macs that take the T8122 router policy (ACIO node names "cpu", shared
t8122.dtsi): J433, J434, J504, J613, J615; their ports get the
PD-ordered sleep and shutdown stop.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The PCIe-C tunnel DARTs probe as devices of their own and sit inside the
ATC's CIO-PCIe block, which their tunnel's root port already names. Give
each DART the same power state so it is never probed or read while that
block is off. apple-dart-pd-check.py reported both as new findings on
the J613 and J615 DTBs; it reports none now.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Folded #2649 in: its seven commits by @RyanTheTide sat directly on this head (154721f), so the branch is fast-forwarded to e690d19 with them unchanged (no force-push). This replaces the three of_machine_is_compatible("apple,j613") gates with property selectors: ACIO picks the T8122 policy when the DT names the MxWrap "cpu" resource, and tipd uses the new pd_ordered_stop typec switch field. Still owed: a J613 regression row on this head (link and replug, as the 11-10 trial). The replug needs hands, so that part waits for Satya; any J613 boot of this tip-based head runs with the SEP initcall blacklisted.

@satchlj
satchlj force-pushed the upstream/j613-usb4-first-link-20261110 branch from e690d19 to b45df16 Compare November 22, 2026 02:38
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Trailer-only rewrite (same tree): dropped Assisted-by from Satya's commits per agent-guidelines; Ryan's and Diljit's commits unchanged apart from parents. e690d19 → b45df16.

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Hands-free J613 row on this PR (RAM boot, SEP disabled, disk read-only; merged onto the current tip together with #2746 and a trial-only console commit; the tipd/USB4/ATC/DWC3 drivers built in because the trial initrd loads no modules):

  • 3 Type-C ports came up (port1 with a partner, the debug-cable side; ports 0 and 2 empty). No USB4 device attached, so no routers (tb=0).
  • Each sn201202x controller (1-08, 1-0a, 1-0c) unbound and bound again through sysfs: rc 0, bound afterwards, port state identical after, partner re-detected, no oops. The debug link stayed up throughout.
  • In all three rows: 580000000.pcie: deferred probe pending: Port /soc/pcie@580000000/pci@0,0 probe fail. I haven't checked yet whether that's the PCIe-C path this PR touches.

Not covered: a physical replug and an attached USB4 device; those need hands and are on the list.

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Attributable J613 row: current tip + this PR + a trial-only standalone console (no #2746, no sleep code), tree DTB unmodified, SEP disabled, disk read-only.

  • 3 Type-C ports up, one with a partner. No USB4 device attached (tb=0).
  • sn201202x 1-08 and 1-0a unbound and bound again: rc 0, bound, same port state after, no oops. The debug-port controller (1-0c) was deliberately left alone.
  • 580000000.pcie: deferred probe pending: Port /soc/pcie@580000000/pci@0,0 probe fail shows here too, so it isn't from soc: apple: sleep: T8122 firmware-sleep data, without gates #2746. I haven't checked whether it's on this PR's path.

Not covered: a physical replug and an attached USB4 device.

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Rebased onto the current integration/aurora (d1b022d), b45df16 → 4bf49c8, pushed with --force-with-lease. #2649 is still folded in. Two conflicts, both resolved by keeping both sides:

  • tipd/tps6598x.h: tipd_shutdown() next to the tip's new tipd_replug_* declarations;
  • t8122-j613.dts: the USB4 aliases next to the tip's new J613 thermal zones.
    Diljit's and Ryan's eight commits keep their author, committer, dates and message (range-diff =). Full kernel and DTB build on the result: 0 errors.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at 4bf49c8 (rebase of b45df16 onto d1b022d).

  • The ACIO and tipd gates are fixed: the T8122 policy now comes from the apple,t8122-usb4-acio match data and the "cpu" resource, and tipd uses pd_ordered_stop. Thanks.
  • The MSI one is still there. apple_msi_init() in pcie-apple.c (~3428) gains of_machine_is_compatible("apple,t8122"), with AIC base 1075 and the ECAM-to-slice table hardcoded in the new pcie-apple-t8122.h. Each PCIe-C node's msi-ranges already names its AIC interrupt, so the base and slice can be read from there (or carried in the apple,t8122-pciec match data) instead of adding another SoC branch.
  • The change now reaches the J615 too: t8122.dtsi gives both ACIO nodes the new regs, and 9333693 wires t8122-usb4.dtsi into t8122-j615.dts. There is no J615 row yet.
  • The J613 rows are from b45df16 with the SEP initcall disabled and a trial console commit. Neither run had a USB4 device attached (tb=0), so the host-to-host path this PR enables was never exercised. We still need a default boot at this head on J613 and J615 with a USB4 link up and a replug. The pcie@580000000 deferred probe is pcie0, the internal port, which this PR doesn't touch. A boot of the plain tip would confirm it's pre-existing.
  • Small one: the /delete-node/ &usb_otg0 in t8122-j615.dts is there to work around older Stage 2 loaders. It would be better fixed in the loader, or the commit should say which loader versions need it.

Assisted-by: LLM (Claude:Opus 5.5)

The T8122 branch of the PCIe-C MSI check matched the machine and looked
each bridge's slice up in a table of ECAM apertures. Each PCIe-C node
already names its slice: apple,msi-vector-base gives the first vector it
owns in the shared window and msi-ranges that vector's AIC line. Check the
slice's shape from those (a 32-vector slice after the internal host's
vectors 0..31) and derive the window's AIC base from them, and select the
branch by the controller's match data instead of the machine.

The host test now reads the slices from the J613 DT and checks them, and
the shapes that must be refused, with the same helper.

Signed-off-by: Satya Benson <satya@benson.earth>
The node was deleted for older Stage 2 loaders that were said to prune
ATC0's shared suppliers through it, but no loader version doing that is
on record. Keep it, as the other T8122 boards do; it stays disabled.

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

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Thanks for the re-review. Pushed 4bf49c8 → 8862194 (two new commits, fast-forward):

  1. MSI slices (0cf2f8f): the T8122 branch no longer matches the machine or looks slices up by ECAM aperture. It's selected by the PCIe-C match data (t8122_pciec_hw), and each bridge's slice comes from its own node. apple,msi-vector-base gives the first vector (it must be a multiple of 32 and at least 32; the internal host owns 0..31), and msi-ranges gives that vector's AIC line. The window's AIC base is derived from the two, so the 1075 constant is gone, and the existing slice check still applies. pcie-apple-t8122.h now holds only that helper, and tools/testing/j613-usb4/run.py reads the slices from the J613 DTS and checks them, plus the shapes that must be refused (PASS). Scope: T8122 only; the t6030/t6040/t8132 branches are unchanged.
  2. J615: there's no J615 row behind this PR. The J615 changes are your commits (9333693 and the J615 DTS); your call whether to keep them here with that stated, or split them out.
  3. USB4 link-up + replug row: owed. My J613 rows ran with no USB4 peer attached (tb=0), on trial kernels. A default-cmdline row at this head with a USB4 device attached and a replug needs hands, so it's on Satya's list.
  4. /delete-node/ &usb_otg0: I can't find any loader version on record that prunes ATC0's suppliers through it, so I've dropped it from J613 (8862194). The node is status = "disabled" in t8122-peripherals.dtsi. The J615 copy is in your commit, so I've left it.

Build check: full arm64 kernel + DTBs at 8862194, 0 errors; the host test passes. It merges cleanly with the current integration/aurora (a463112).

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at 8862194 (fast-forward of 4bf49c8).

  • MSI: fixed. The T8122 branch in apple_msi_init() is now chosen by t8122_pciec_hw, and the window base comes from each node's apple,msi-vector-base plus its msi-ranges line. The 1075 constant, the ECAM table and the machine match are gone. The values in t8122-usb4.dtsi (32/1107, 64/1139) match the ADT: msi-vector-offset 0x433 on apciec0/1, bridge msi-vector-base 0x20/0x40. That holds on the J615 ADT too.
  • One gap the per-node check leaves: two bridges that name the same slice both pass. I set both nodes to base 32 / AIC 1107 and run.py still passes, and the driver would accept both and point both MSI maps at the same vectors. The old table ruled that out. A small mask of slices already claimed by a PCIe-C bridge in the driver, plus a distinct-bases assert in the test, would close it. The test already checks each node's window against the internal host's msi-ranges, which is good.
  • Binding: apple,msi-vector-base is now mandatory for apple,t8122-pciec in the driver, but apple,pcie.yaml doesn't require it for that compatible or state the shape (multiple of 32, 32..224). T6030 nodes reuse apple,t8122-pciec without it (the legacy 1342 correction), so the constraint probably belongs in the t8122 if-block rather than a blanket required.
  • tools/testing/j613-usb4/run.py runs and passes here. It isn't hooked into any runner, though, and it pulls the function out of pmgr-pwrstate.c by string search. Both functions it tests are pure, so KUnit cases would run with the rest of the tree. Not a blocker. (It reads the shared t8122-usb4.dtsi, so it covers J615's slices too.)
  • usb_otg0: dropped from J613, thanks. The J615 copy is still in t8122-j615.dts.
  • J615: splitting 9333693 (the J615 DTS) into its own PR with a J615 row would be cleaner, and the J615 /delete-node/ could go with it.
  • Still open: a default-cmdline J613 row at this head with a USB4 peer linked and a replug.

Assisted-by: LLM (Claude:Opus 5.5)

Two PCIe-C nodes naming the same apple,msi-vector-base would both pass
the slice check and program the same vectors of the shared window. Claim
each 32-vector slice when a bridge's MSI is set up and release it with the
device, so the second bridge fails with an error naming the slice. Also
refuse a vector base past 224, the window's last slice.

The host test checks that the J613 DT's PCIe-C bases are distinct.

Signed-off-by: Satya Benson <satya@benson.earth>
The T8122 PCIe-C driver takes each bridge's MSI slice from
apple,msi-vector-base. Require it for apple,t8122-pciec bridges, as a
multiple of 32 from 32 to 224 (the shared window after the internal host's
vectors 0..31).

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

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Pushed 8862194 → ca0bc8d (--force-with-lease on the full SHA):

  1. One bridge per MSI slice (7e7b5942): each T8122 32-vector slice is claimed when a bridge's MSI is set up and released with the device (devm, so a deferred or failed probe, or an unbind, frees it). A second bridge naming the same apple,msi-vector-base fails with an error giving that slice's vectors. A base past 224 is refused. The host test asserts the J613 DT's PCIe-C bases are distinct. The release path (failed probe, unbind/rebind) isn't covered by run.py, which only exercises the pure helper; that needs KUnit or a row.
  2. Binding (bff98d35): apple,msi-vector-base is required in the apple,t8122-pciec if-block, a multiple of 32 from 32 to 224. T6030 doesn't match that block. dt_binding_check DT_SCHEMA_FILES=pci/apple,pcie.yaml is clean.
  3. J615 split: 9333693 is out of this PR and now in arm64: dts: apple: t8122-j615: describe the USB4 PCIe-C tunnels (stacked on #1490) #2812, stacked on this one, carried unchanged. The seven commits after it here are range-diff =; the only tree change is the J615 DTS.
  4. KUnit: not done this round.

Build: full arm64 kernel + DTBs at ca0bc8d, 0 errors; the host test passes; it merges cleanly with integration/aurora. Still owed: the default-cmdline J613 row with a USB4 peer and a replug (needs Satya's hands).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of ca0bc8d. All three points are covered:

Small nit: the claim failure jumps to invalid_slice. If that returns a different errno, the -EBUSY and its message are what the log should show. Code-wise this is fine from my side. The default-cmdline J613 row with a USB4 peer and a replug is still the remaining item.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

The folded-in USB4 follow-up is with BRINGUP-J615-5 and J615-TB for three J615 s2idle cycles with a stable USB4 peer, followed by shutdown and reboot. Please record the exact tested head and peer state. The previously observed peer-drop hang is a separate row.

At ca0bc8d9, host tests and KUnit pass. The required apple,msi-vector-base property introduces two new DT warnings for the enabled apple,t8122-pciec controller at pcie@730000000 on J514s and J516s. Please reconcile the binding and probe behavior with those existing users before requesting the hardware rerun. dt-checks job

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