Skip to content

arm64: dts: apple: t8132: keep the USB4 router DARTs out of the router's power state - #2691

Open
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
j713-s2r/usb4-dart-no-pd
Open

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
j713-s2r/usb4-dart-no-pd

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Since 202ede05e539 gave the T8132 USB4 NHI DARTs power-domains = <&ps_atcN_cio>, a deep sleep of an M4 MacBook Air with a USB4 partner attached does not come back. The native CIO sleep powers the router's states off from the NHI's noirq suspend. The DART is a supplier of the NHI and suspends after it, so genpd keeps ATCN_CIO on. The CIO sleep then unwinds, its recovery fails the same way, and the SoC watchdog resets the machine about two minutes later. With the console suspended, nothing is logged.

Change

Drop power-domains from usb4_0_dart and usb4_1_dart again, with a comment saying why. The DART doesn't need it: the router populates it only after powering its own states, and the native CIO sleep saves and restores it across their power cycle.

Testing

On a J713 on the macOS 27.2 stub, with a USB4 host-to-host cable to another Mac, using a lab kernel carrying the other 27.2 deep-sleep fixes (DCP stop #2660, PMP data segment, Wi-Fi WoWLAN, CIO XDomain):

Still to run

  • A dock with a PCIe tunnel (the PCIe-C DART keeps ps_atcN_cio_pcie; the CIO sleep takes that state down first).

Assisted-by: LLM (Claude:Opus 5.5)

…r's power state

Since the USB4 NHI DARTs were given power-domains = <&ps_atcN_cio>,
every deep sleep of an M4 MacBook Air with a USB4 partner attached hangs:
the DART, a supplier of the NHI, suspends after the NHI's noirq suspend,
so the native CIO sleep, which powers the router's states off from that
noirq suspend, finds ATCN_CIO still held on, unwinds, and fails again in
its recovery. The SoC watchdog then resets the machine.

The DART does not need the state named: the router populates it only
after powering its own states, and the native CIO sleep saves and
restores it across their power cycle. Drop the property again on both
routers and say why.

Fixes: 202ede0 ("arm64: dts: apple: t8122/t8132/t603x: give the remaining DARTs their power domains")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… is covered

A USB4 router's DARTs are children of the router node, which names the
router's power states. The router driver populates them only after it
has powered those states, so they are never probed while the block is
off, and naming the same states on the DART holds them on through the
native CIO sleep. The check counted such a DART as a new gap.

Treat a DART without power-domains as covered when its parent is a
device node (not a simple-bus or similar, which platform code
populates) with power-domains of its own, and require the parent's
domains to be enabled. This is read from the tree's structure, not from
a list of boards. On today's integration DTBs it exempts nothing new;
it accepts the four T8132 router DARTs once they drop their domains.

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

Copy link
Copy Markdown
Contributor Author

No blockers. Dropping power-domains from usb4_0/1_dart is consistent with how the router driver handles them: it adds its runtime links to all its domains before of_platform_populate() and depopulates before dropping them, so the DART never exists with the block off. The DART's suspend/resume callbacks skip register access while the CIO owner holds it, so the native sleep's domains-off check (which returns -EBUSY while genpd is on) can now pass. I built all Apple DTBs at base and head. The old checker reports the four T8132 router DARTs as new gaps, the new one reports none, and on base DTBs the new exemption matches nothing, so no existing gap is hidden. The checker unit tests pass. Two small points. The dtsi comment talks about the native CIO sleep, but J715 shares this file and never takes that path, so it would read better with the populate/depopulate ordering as the main reason. The new checker exemption relies on the parent's driver populating children only after powering them, which only the USB4 router does today: either restrict it to the router compatible or state that requirement in the docstring. Still needed before merge: the dock-with-PCIe-tunnel deep-sleep row (the PCIe-C DART keeps ps_atcN_cio_pcie, which the sleep takes down first), and a J715 boot/sleep row with a USB4 partner, since J715 gets the same DT change.

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

Adversarial pre-PR checklist review at 2fa243c99e6464e1aa70ea08f1e5a5374c445537 (COMMENT — 0 code/policy/attribution blockers, holding only for missing §5 HW rows).

Checklist Summary

  • §1 (No model gating): Pass — DT fix removes power-domains from usb4_0_dart / usb4_1_dart in t8132-usb4.dtsi; scripts/dtc/apple-dart-pd-check.py determines coverage from DT structure (powered_device(parent)), not a board/SoC list.
  • §2 (No hacks / default cmdline): Pass.
  • §3 (Safety / DT / checker correctness): Pass — verified:
    • In drivers/thunderbolt/apple.c, apple_cio_start() (:3433-3449) adds runtime-active DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE links (and dev_pm_syscore_device(..., true)) for all router domains (ps_atcN_cio, ps_atcN_cio_pcie, ps_atcN_cio_usb, ps_atcN_pcie) before calling of_platform_populate(acio->np, ...) (:3577), and apple_cio_stop() (:3171) calls of_platform_depopulate() before dropping those links. Thus usb4_N_dart is never probed while ps_atcN_cio is powered off on either J713 or J715.
    • Dropping power-domains = <&ps_atcN_cio> from usb4_N_dart resolves the supplier noirq suspend ordering deadlock in apple_nhi_cio_domains_off() (drivers/thunderbolt/apple-cio-sleep.c:687-707), while apple_dart_suspend/resume skip register access while dart->cio_active is held.
    • scripts/dtc/apple-dart-pd-check.py properly excludes simple-bus/simple-pm-bus/simple-mfd/isa and checks parent domains for disabled status, with 4 new unit tests passing.
  • §4 (Clean-room & attribution): Pass — both commits (2eb9771e, 2fa243c9) have human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and Signed-off-by: only; PR body includes Assisted-by:.
  • §5 (Evidence): Incomplete — J713 USB4 host-to-host 10/10 deep-sleep clean proof and dtbs_check are in, holding for the remaining HW rows below.
  • §6 (Naming): Pass.
  • CI: 2/2 checks PASS (dt-checks, host-tests).

Non-blocking Nits

  • arch/arm64/boot/dts/apple/t8132-usb4.dtsi:80-85, 202-207: J715 shares t8132-usb4.dtsi and does not take the native CIO sleep path; leading the comment with the router's populate/depopulate power lifecycle makes it accurate for both J713 and J715.
  • scripts/dtc/apple-dart-pd-check.py:137-143, 160-167: powered_device() assumes any non-bus parent with power-domains powers its domains before populating child DARTs (true for apple,*-usb4-acio today). Consider stating that requirement in powered_device()'s docstring or narrowing to known populate-after-power compatibles; also note disabled_domains() reports only bad[0] if a parent has multiple disabled domains.

Remaining §5 HW Rows Before Approval

  • J713 deep-sleep row with a dock carrying a PCIe tunnel (explicitly listed under Still to run — usb4_N_pcie_dart retains ps_atcN_cio_pcie and needs end-to-end verification across native CIO sleep/wake).
  • J715 boot + sleep row with a USB4 partner (shares t8132-usb4.dtsi without the native CIO sleep path).
  • Explicit confirmation of SELinux Enforcing / 0 AVC denials alongside 0 failed units and 0 new kernel errors on the regression rows.

Assisted-by: LLM (Gemini 4 Neon)

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.

2 participants