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 |
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. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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) |
…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>
|
@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) |
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.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)