Repository navigation
Conversation
9736db6 to
963d155
Compare
|
Rebased onto integration/aurora 0abc2f3. It is now 963d155 (was 9736db6); the old branch no longer merged.
|
|
Thanks for the J813 rear-port USB4 work. The sleep handling, and the hardware-reason comments on it, are good to have. One small thing: Happy to run a no-regression row on our other Macs once it's updated. |
963d155 to
4ed06b3
Compare
|
Done. It is now 4ed06b3 (was 963d155). Only "PCI: apple: support T8142 PCIe-C MSI slices" changed (now adee45b); the other three commits are identical (
Checked: #2238 is restacked on this head (6113f94, content unchanged). #2178 (T8152, 1879) has the same pattern and gets the same treatment in its rework. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks for the quick rework. At 4ed06b3 the machine check is gone (pcie-apple.c:3446-3447). I'd still like the AIC base out of the driver, because the DT already says it. msi-ranges names the AIC input of global vector apple,msi-vector-base, and the window is linear, so args[1] - apple,msi-vector-base is the base. On J813 every node gives 1741 (internal 1741 at 0, front 1837 at 96, rear 1869 at 128). msi_aic_base and the ECAM-keyed expected_base switch only re-derive that from a table, and #2178 is about to add a third constant.
Concretely, for the T8132/T8142 branch:
- Read
apple,msi-vector-basefirst. - Check the slice structurally: 32 vectors, 32-aligned, above the internal port's vectors, within
FIELD_MAX(PORT_MSIMAP_TARGET) + 1, edge-rising SPI,args[1] >= base. - Drop
msi_aic_baseand the ECAM table.
No binding change is needed: both properties are already required for t8142 PCIe-C. If you want the cross-node check, "all PCIe nodes agree on msi-ranges[1] - apple,msi-vector-base and the slices are disjoint" fits apple-dt-check better than the driver. T6030/T6040/T6050 can follow in a separate PR.
Two merge gates besides that:
- Rerun CI: both runs on 4ed06b3 were cancelled by the runner, not failed.
- The
usb4-1-pciealias needs aura#302, which is still open, and the qualified boot used the underscored alias with an older aura. Please post one boot of this exact DTB with an aura that has #302: link up, and the PCIe-C tunables present under the apciec1 node.
Minor, non-blocking: thunderbolt/apple.c keys three behaviours on acio->hw == &apple_cio_t8142_hw (4011, 4257, 4742). Named flags in apple_cio_t8142_hw would carry to the next SoC more easily.
|
Thanks for adee45b. Taking the AIC base from the match data and selecting the branch by |
4ed06b3 to
13483df
Compare
|
Thanks. All three points are done. The head is now AIC base from the DT (
Named flags ( CI and the aura#302 boot.
|
|
@DjDeveloperr could you take another look when you have a moment? Your remaining point, taking the AIC base from the DT, is in |
|
For the aura side this PR depends on: our J616s (T6040) row with aura#302 is at aurora-silicon/aura#302 (comment). With #302 the production aura's three At 13483df, T6040 keeps its own |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks, Thomas. All three points from my 11-19 review are done at 13483df:
- The AIC base comes from the DT. The T8132/T8142 branch of
apple_msi_init()checks the slice by its shape alone: three-cell edge SPI,args[1] >= apple,msi-vector-base, thenapple_t6030_msi_slice_valid().msi_aic_baseand the ECAM table are gone, and so is T8132'sof_machine_is_compatible(). Both T8132 trees carryapple,msi-vector-base(0x60 and 0x80), so they pass the new check with the same 1506 window base. - Named flags in
apple_cio_t8142_hwreplace the threeacio->hw ==comparisons. - The aura#302 boot and the control without it are posted, and CI is green.
No T8142 board other than the J813 enables an ACIO node, so the new router start and sleep handling reach only this rear port.
One problem shows up only when the PR is merged with the current tip. 4c72367 ("thunderbolt: apple: T6050: keep a port up for a freeze while deep is the default") landed on integration/aurora after your base. It adds if (pm_suspend_no_platform()) return false; to apple_cio_sleep_tears_down(). A three-way merge puts your new early return ahead of it:
if (READ_ONCE(s2idle_teardown) || apple_cio_sleep_removes_domains(acio))
return true;
/* A "freeze" is a suspend-to-idle with deep as the default too: the port stays up. */
if (pm_suspend_no_platform())
return false;apple_cio_sleep_removes_domains() only checks !pm_suspend_default_s2idle(). So on a J813 with deep as the default, a freeze would still tear down the rear port. Because mode is forced to 1, it would also refuse the freeze when a disk is open, although a freeze removes no CIO domain. The t6050 || apple_cio_sleep_removes_domains(acio) wait in apple_cio_sleep_teardown() gets the same answer.
The fix is one line once rebased:
return acio->hw->sleep_removes_domains && !pm_suspend_default_s2idle() &&
!pm_suspend_no_platform();Please rebase onto the tip with that, and it merges as soon as CI is green.
Non-blocking: in apple_cio_sleep_teardown() the local is still called t8142. Something like removes would match the flag.
These rows come after the merge, with a revert ready:
- your clean-build replug matrix;
- one freeze (
echo freeze > /sys/power/state) with the enclosure attached and a disk open, to show the port stays up; - an M4 mini (T8132) boot with a USB4 NVMe enclosure, since T8132 moved to the new slice check.
13483df to
a5c9b6e
Compare
|
@DjDeveloperr thanks, done. The head is now The freeze fix, in "thunderbolt: apple: support T8142 router startup and deep sleep": return acio->hw->sleep_removes_domains && !pm_suspend_default_s2idle() &&
!pm_suspend_no_platform();A freeze therefore removes no CIO domain on the J813 either. Non-blocking: the local in
Checks on this head:
#2238 is restacked on this head; its front-port commit is unchanged (range-diff For the rows after the merge: the USB4 enclosure is on the M6 at the moment. I'll post the replug matrix and the freeze with a disk open once it's back on the J813. |
|
@DjDeveloperr the enclosure is back on the J813. I ran your after-merge rows now, on this exact head Setup:
Freeze with a disk open:
Physical replug matrix (rear port, same boot):
T8132: I don't have an M4 mini for the T8132 row. @RyanTheTide, could your team run one with a USB4 NVMe enclosure when this merges? |
|
Thanks for running the freeze and replug rows on a5c9b6e. On the T8132 row: we don't have an M4 mini, but we do have an M4 MacBook Air (J713), which is the same T8132 and goes through the same |
a5c9b6e to
b28768e
Compare
|
Rebased onto integration/aurora Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of b28768e: a rebase only. The three driver commits are unchanged, and the DTS commit differs only in where the Assisted-by: LLM (Claude:Opus 5.5) |
|
@RyanTheTide on the AP firmware tuning point from #2238: this PR now ends with Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of 79afc92. A node that describes the Assisted-by: LLM (Claude:Opus 5.5) |
79afc92 to
f3415a2
Compare
|
Rebased onto integration/aurora 95a13cf. The head is f3415a2, and only the two conflicts below changed.
Commits 1 and 5 are identical. 2-4 differ only by these resolutions and their context (range-diff checked). Checks at this head:
No new J813 row, because the M5 is not available right now. The code is unchanged. Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of f3415a2: a rebase only. Commits 1 and 5 are the same patches, and 2-4 differ only by the Assisted-by: LLM (Claude:Opus 5.5) |
|
@DjDeveloperr could you take another look and clear your change request? It is from 11-20, and everything in it was done the same day:
The head is f3415a2, a rebase only since then (Ryan range-diffed it; his approval stands). All three checks pass (dt-checks, host-tests, kunit), and it merges cleanly on integration/aurora b10280c. #2238 merges right after it. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review on f3415a28a01985f4945939f0ecf09bf609387875:
The driver changes (7538f745faa0, f9b070b6b012, b0e95f9647f2, f3415a28a019) read cleanly — DT-derived MSI slice validation for T8132/T8142, named apple_cio_hw flags, the pm_suspend_no_platform() freeze fix, and fail-closed apple,tunable-router-ap-fw validation are solid, and all 5 commits have clean human Signed-off-by: trailers (§4) with green CI (dt-checks, host-tests, kunit).
Two concrete blockers remain before merge:
-
§3 / §4 — Remove hardcoded Apple ADT tuning tables from
arch/arm64/boot/dts/apple/t8142-j813-usb4.dtsi(53395d36661a):t8142-j813-usb4.dtsistill hardcodesapple,tunable-router-ap-fw = <0x8 0xff2 0x482>onacio1(line 220) and 22 rows ofapple,tunableonacio1_dart(lines 251–272) with the stale comment/* ACIO DART tunables are not supplied by the bootloader. */.- Both
aurora-silicon/aura#302andaurora-silicon/aura#435are now merged, soaurasupplies both properties from the machine's ADT (just as#2238already relies on foracio0/acio0_dart). - Keeping these Apple ADT values in-tree violates §4/§3 and defeats commit 5 (
f3415a28a019) on the rear port itself (an older loader withoutaura#435will probeacio1using the hardcoded table instead of failing closed). Please drop both in-tree tables fromacio1andacio1_dart.
-
§5 — Live-hardware verification on the exact final head with full regression tuple:
- Commit 5 (
f3415a28a019) and the rebase onto95a13cf618b1have not been booted on J813 yet ("The new check hasn't run on hardware","No new J813 row"). - The earlier
a5c9b6e14273run predates commit 5 and omits the required §5 regression checks (SELinux mode +0 AVC denials,0 failed units, and explicit kernel error check / kernel build version). - After removing the hardcoded
acio1/acio1_darttunables (and rebasing onto currentintegration/aurora), please post a J813 boot row on the exact live head withauracarrying#302+#435confirming:acio1andacio1_dartreceive their tunables fromaura, rear USB4 NVMe + open-disk freeze + sleep/replug pass, and the full §5 regression tuple (exact head SHA, hardware, kernel/build, SELinux mode,0 AVC denials,0 failed units,0 new kernel errors).
- Commit 5 (
Note (§1 cross-SoC): T8132 shares the reworked apple_msi_init() branch; please also keep the planned J713 / T8132 regression check tracked.
Assisted-by: LLM (Gemini 4 Neon)
Allow the five ACIO register windows, LSTX GPIO and router firmware tunables used by T8142. Describe its native PCIe-C compatible and require the shared MSI vector base. Include the T8142 pinctrl fallback chain used by the AOP LSTX pin. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
T8142 uses the Intr2AXI controller layout but its three-cell AIC interrupt specifier and MSI window differ from T6050. Match it natively. This allows a tunnelled NVMe controller to allocate working MSI-X interrupts. For T8132 and T8142 the slice is checked against the device tree alone. msi-ranges names the AIC input of global vector apple,msi-vector-base in a linear window, so the window's AIC base is msi-ranges minus apple,msi-vector-base, and the slice is checked by its shape: an edge-rising SPI, 32 vectors, 32-aligned, above the internal port's vectors and inside the 8-bit map target. This replaces T8132's table of ECAM apertures and its AIC base 1506 behind a machine check. The T8132 trees give 1602 - 0x60 = 1634 - 0x80 = 1506, and every J813 PCIe node gives 1741. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Use the qualified MxWrap startup sequence: CIO reset leaves the CPU running, then RTKit readiness precedes the LSTX handoff. Admit native T8142 PCIe-C hosts without a T6050 fallback. Keep DP IN disabled. Deep sleep removes CIO power. Remove idle NVMe hierarchies before stopping the router and request fresh cable state on resume. Refuse sleep when a disk is open or another endpoint driver cannot be removed safely. A freeze removes no CIO domain, also with deep as the default, so it keeps the port up and refuses nothing. Extend the production-C admission tests with native T8142 and a negative control. The T8142 behaviours are named flags of its match data (sleep_removes_domains, restart_on_wake, phy_shared_with_dwc3), so a later SoC that behaves the same sets them instead of extending a comparison. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe ACIO1, its mailbox and LSTX pin, and the PCIe-C tunnel. Populate both DARTs under their powered parents. Use connector port 4 so the existing DisplayPort alternate-mode route can retain port 3. Name the PCIe-C tunable alias usb4-1-pcie, as t6040-usb4.dtsi does; aura looks it up under that spelling since aurora-silicon/aura#302. The DT carries no tunable values. The bootloader fills the router's, the AP firmware one included, through usb4-1-acio, the PCIe-C ones through usb4-1-pcie, and the router DART's through its generic DART copy, which finds the DART by its translated address (aurora-silicon/aura#435). Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
…ndow A host router whose node describes the router-ap-fw window gets its AP firmware tuning from the bootloader, which copies it from the machine into apple,tunable-router-ap-fw. A loader that leaves it out used to give a router that runs untuned, with nothing logged. Fail the probe instead, as a missing apple,tunable-rc does, so a too-old loader is seen. Every tree that describes the window today either carries the property or has it filled in by the loader: the T6050 host routers and the J813 rear port in the tree, the J813 front port through aura. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
f3415a2 to
a42e7dc
Compare
|
@DjDeveloperr thanks. Blocker 1 is done. Blocker 2, the J813 row, needs a boot with the enclosure and follows. 1. No tunables in the tree. Head
2. J813 row on this exact head. Its kernel (integration/aurora
It will cover the tunables reaching The J713 / T8132 MSI-slice check stays tracked; Ryan's team runs it. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review on a42e7dccf46cb5f24b8b886dcfaa0f78ed58ef28:
Wave 89E Blocker Verification
- §3 / §4 — Hardcoded Apple ADT tuning tables in
arch/arm64/boot/dts/apple/t8142-j813-usb4.dtsi: Resolved. Commit26f3957815d2removes bothapple,tunable-router-ap-fwonacio1and the 22apple,tunablerows onacio1_dart; zero in-tree tunable values remain,aurora-silicon/aura#302(18a4797f) andaurora-silicon/aura#435(f1daef3e) are both merged, and commita42e7dccf46cfails closed (-EINVAL,"Missing bootloader router AP firmware tuning") if an older loader omits the property. - §5 — Live-hardware verification on the exact final head with full regression tuple: Still open (blocker).
- Exact head
a42e7dccf46c(with the in-treeacio1/acio1_darttunables removed, commit 5's fail-closedapple,tunable-router-ap-fwcheck, and the rebase onto70a00e583b03) has not yet been booted on J813 ("The boot rows below predate this and used the in-tree values; the row on this head is pending"). - Once your in-progress J813 build + UGREEN rear-port run with
auracarrying#302+#435completes, please post the row confirming:acio1andacio1_dartreceive their tunables fromaura, rear USB4 NVMe tunnel + checksums + open-disk freeze + sleep/replug pass, and the full §5 regression tuple (exact head SHA, hardware, kernel/build, SELinux mode,0 AVC denials,0 failed units,0 new kernel errors).
- Exact head
Checklist Summary (§1–§6)
- §1 (No model gating): Pass — DT-derived MSI slice check for T8132/T8142 and named
apple_cio_hwflags (T8132 J713 regression check remains tracked). - §2 (Production-ready / default cmdline): Pass.
- §3 (Safety): Pass — tunables come from the machine via
aura#302/#435, and missingapple,tunable-router-ap-fwfails closed. - §4 (Clean-room & attribution): Pass — all 5 commits carry human author/committer and human
Signed-off-by:only (zero AI trailers in commits), no Apple ADT tuning values remain in-tree, and the PR body disclosesAssisted-by:. - §5 (Evidence): Blocked on the pending J813 live-hardware row on
a42e7dccf46c(anddt-checksCI finishing green;host-testsandkunithave already passed). - §6 (Naming): Pass.
Non-blocking Nit
- Commit 5 (
a42e7dccf46c) message still says "the T6050 host routers and the J813 rear port in the tree"; if you touch the branch again, update it to reflect that the J813 rear port now gets the property fromauraas well.
Assisted-by: LLM (Gemini 4 Neon)
|
J813 row on the exact head Setup
Fail-closed check (negative control): the same kernel booted by the J813's enrolled aura, which has neither #302 nor #435:
Counts on the row boot: 0 failed units, 0 AVC denials (SELinux not enabled), 0 new kernel error lines against the default boot, 0 DART faults. Not in this row: a physical replug; nobody was at the Mac. The physical replug matrix (idle, under read, disk open, flipped) ran on 11-20 on that day's head The front port (#2238) follows once the enclosure is moved there. Assisted-by: LLM (Claude:Opus 5.5) |
The J813 rear USB-C port can enumerate a USB4 storage enclosure, but the existing T8142 match data follows the wrong router startup sequence and has no native PCIe-C MSI setup. This enables the rear port with the MxWrap/RTKit/LSTX sequence verified on hardware, native PCIe-C match data and validated 32-vector MSI slices, and the corresponding device tree and bindings.
Deep sleep releases idle NVMe tunnels before the shared USB PHY shuts down, then requests fresh cable state after wake. An open disk or an unsupported endpoint driver refuses sleep. The notifier runs before DWC3: the initial default-priority version exposed a link-loss race during refusal, reproduced and covered by a production-registration test and negative control.
Hardware: J813 / T8142, rear port, UGREEN enclosure (vendor 0x00b8, device 0x2463), Samsung 980 PRO 2 TB, firmware 5B2QGXA7. The clean series is based on integration/aurora at f44bf7a. Runtime qualification used the same changes on the full J813 stack from #2135, retaining its display, GPU, radio, audio, media and sleep work.
Validation:
usb4-1-pcie(as in t6040-usb4.dtsi), which aura looks up since kboot: accept the hyphenated usb4-N-pcie alias for PCIe-C tunables aura#302.usb4-1-acio, the PCIe-C ones throughusb4-1-pcie, and the router DART's through its generic DART copy (devicetree, kboot: translate DT addresses through every ranges; copy the USB4 router AP firmware tunable aura#435). With a loader older than mux: apple-display-crossbar: T6041 (M4 Pro/Max) per-ATC crossbar #435 the router probe refuses ("Missing bootloader router AP firmware tuning") instead of running the port untuned. The boot rows below predate this and used the in-tree values; the row on this head is pending.pcie-tunnel-N/pcie@...nodes, the rear link comes up at 20 Gb/s x 2, NVMe gets its MSI-X queues, and a 4 GiB direct read runs at 2.9 GB/s. With the enrolled aura (no drm/apple: dcp: let a Type-C port with HPD take over a pipeline held without it #302) the same DTB gives "PCIe-C tunnel disabled: not initialized by m1n1 or the kernel" and the enclosure falls back to USB.Scope: rear port only. USB4 DisplayPort tunnels stay disabled; the existing DP alternate-mode graph remains separate on connector port 3. Other enclosures, front-port USB4, write workloads, mounted-storage suspend, external-display combinations and long-duration sleep remain unqualified. The final clean build's physical replug matrix is still pending; the preceding bring-up build was tested through physical unplug/replug. Existing firmware/property and IRQ-affinity messages remain, so this is a functional qualification rather than a clean-dmesg claim. Raw logs, per-unit identities and firmware remain private.
Assisted-by: LLM (Claude:Opus 5.5)