Skip to content

arm64: dts: apple: t6050: keep the ATC usb-aon power domains on (J714s Type-C dead after s2idle) - #2018

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s/phy-s2idle-domains
Nov 16, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s/phy-s2idle-domains

Conversation

@Isaac-Duarte

@Isaac-Duarte Isaac-Duarte commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

This PR changed approach. It carried a PHY-side hold in the T6050 Type-C PHY driver; it now carries a device-tree change instead. See History below. The earlier review comments and TripleU613's report refer to that earlier version.

What

One commit, arm64: dts: apple: t6050: keep the ATC usb-aon power domains on (64d473f532): apple,always-on on every T6050 ATC usb-aon power domain, five lines in four files.

file domain
t6050-peripherals.dtsi atc0
t6050-dieX.dtsi atc1, on each die
t6050-die0.dtsi atc2, atc3
t6050-ultra.dtsi atc4

The older SoCs (T8103, T8112, T600x, T602x: "Needs to stay on for dwc3 to work") and T604x mark these domains always-on. T604x does atc0–2 in its pmgr dtsi and atc3 in t604x-extdisp.dtsi. T603x, T8122, T8140 and T8132 outside the J713 do not; the J713 marks its own apple,inherited-on. Neither did T6050 until this change.

Why

On the J714s both Type-C ports were dead after an s2idle wake until a reboot. The PHY's first start after the wake times out in its first power-up step:

apple-t6050-dp-phy 2ab000000.phy: start of mode 1 failed (-110)
apple-t6050-dp-phy 383000000.phy: CIO mode failed (-110), reverse orientation, 1 ms
sn201202x 2-0c: failed to place Type-C mux in safe mode: -5

Traced (pmgr-pwrstate and genpd dynamic debug, PHY module without any s2idle handling, s2idle 12:04:42 to 12:05:46): at the noirq suspend, genpd gated atc2_usb, atc2_common and atc2_usb_aon, then the same three for ATC1. All six came back to 0xf at the resume, and the plug then failed.

  • atc*_usb was off when genpd took it over (idle 4–5 ms at boot). pmgr-pwrstate gives GENPD_FLAG_ACTIVE_WAKEUP only to a domain on at probe, so it lacks the flag, and the wakeup-enabled dwc3 glue in it counts as suspended.
  • The domain went off with its last DART. Its parents common and usb-aon followed in the same cascade, because their own devices (the display crossbar's and the PHY's) had already suspended.
  • Nothing sets the PHY up again at an s2idle wake.

Which domain matters: DjDeveloperr noted that the usb_aon domains should not be turned off ("aon = always on"). Marking only usb-aon always-on fixes it, with no PHY change: usb and common still go off in s2idle, and that is harmless. Keeping usb-aon on is enough.

Effect elsewhere:

  • Runtime, J714s and J716c: nothing changes. The display crossbar holds the domain from its probe on (J714s atc1/atc2, J716c atc0–2), so there usb-aon was already on permanently, and that is known to work.

  • Runtime, other T6050 boards: the crossbar is disabled, so a usb-aon domain used by a PHY went off while its port was idle, and now stays on:

    boards domains
    J714c, J716s, K114c, K116s atc1, atc2
    J775c, J873s atc1, atc3
    J775d atc1, atc3, atc4, atc5

    An enabled usb-aon domain with no user is now powered at probe: atc3 on the J714c, J716c, J716s, K114c, K114s, K116c and K116s, and atc1 on the K114s and K116c.

  • Deep sleep: genpd no longer gates usb-aon in its noirq phase. The J714s already keeps ATC3's usb-aon on through the commit (t6050-j714s-sleep.dtsi, T6050 (M5 Pro, J714s): suspend to RAM #1963). Deep sleep cannot run on the J714s today, so this is untested.

Context and merge order: s2idle is reachable on the J714s only with #1647 and #2012 (the allowlist). Merge #1647 → #1789 → this → #2012, or all together.

Tested

J714s (MacBook Pro 14" M5 Pro). Kernel 7.3.0-b248cfe, build #2: integration/aurora b248cfe plus carried commits, including #1647, #1789, the allowlist line (#2012) and the left-back port's description. The PHY module was the original one (build-id 171ecc47…, no s2idle handling) in both runs.

run DTB result
15:27, one s2idle of 42 s experiment: atc0/1/2 usb-aon always-on during the sleep, atc*_usb and atc*_common went to 0x0 on all three ports and back to 0xf; usb-aon never written. After the wake, the dock on the right port came up in CIO mode at the first plug, with 3 displays.
15:42 boot, three s2idle sleeps by lid: 39.0 s, 102 s, 12 min 16 s this patch (linux-latest + this commit, semantically identical to the experiment DTB) after every wake the dock came up in CIO mode at the first plug on all three ports (right, left-front, left-back), rotating the first port. 30 display routed in the boot, 20 of them after sleeps 2 and 3. No start of mode, CIO mode failed, sn201202x or tunnel-activation errors. With pmgr dyndbg on during sleep 2: usb and common of atc0/1/2 each went 0x0 once and back, and usb_aon was never written. Sleep 3's log shows only the resume's 0xf writes, probably lost to the ring buffer. suspend_stats: 4 successes, 1 failure (an immediate entry/exit right after a lid close, the usual retry).

Build: all DTBs at integration/aurora c0a2a75, base and patched, LLVM, W=1: no new warnings. The pre-existing ones are identical at base and head (815 lines; e.g. simple_bus_reg on /soc/pmp@284e00000, unit_address_vs_reg on reserved-memory in the j714s/j716c/k114c GPU dtsi), apart from one line number. Exactly 11 DTBs change, all T6050: j714c, j714s, j716c, j716s, j775c, j775d, j873s, k114c, k114s, k116c, k116s.

Not tested:

  • Deep sleep: unreachable on the J714s today (apple-sleep does not probe; mem_sleep offers s2idle only).
  • Other T6050 boards:
    • The J716c is already s2idle-qualified and has the same crossbar hold, so it likely had the same failure and gets the same fix.
    • On the boards listed under Runtime, the idle-power cost of the usb-aon domains that now stay on is unmeasured.
    • So is the PHY there without a usb-aon power cycle between port uses.
    • If reviewers prefer, a J714s-only override (&ps_atc{0,1,2}_usb_aon { apple,always-on; }; in t6050-j714s.dts) is the fallback.
  • A long s2idle power measurement with this patch: pending. The earlier PHY-hold version measured 1.95 W over 57 min (PCI: apple: suspend-to-idle on the J714s (adopted N1 link; stacks on #1647) #2012); usb and common now go off in s2idle, so the draw may be lower.

To run before merge

  • J714s: three or more s2idle cycles on one boot, with a dock plugged in after each, on all three ports.
  • J714s: a long unplugged s2idle with a power measurement.
  • A second J714s with this version (TripleU613's report below covers the earlier PHY-hold version).
  • Another T6050 board (J716c, K116s) across s2idle, if someone can.

History

@TripleU613

Copy link
Copy Markdown
Contributor

Test report from a second J714s (MacBook Pro 14", M5 Pro), for #1647 + #2012 + #2018 together.

Thank you all for this, it's the first time this machine has had a working lid sleep here.

🤖 Generated with Claude Code

@Isaac-Duarte

Isaac-Duarte commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Back to draft: following dj's note that the usb_aon domains shouldn't be turned off, a test on the J714s showed that marking only the ATC usb_aon power domains apple,always-on (without this PR's PHY-side hold) keeps USB-C working after s2idle: during the sleep atc*_usb and atc*_common still go off, usb_aon stays on, and the dock comes back on the first plug. I'm turning this into that DT change and will update or replace this PR once it's tested on all three ports.

On the J714s both Type-C ports are dead after a suspend-to-idle wake.
The PHY's first start after it times out in its first power-up step:

  apple-t6050-dp-phy 2ab000000.phy: start of mode 1 failed (-110)
  apple-t6050-dp-phy 383000000.phy: CIO mode failed (-110), reverse orientation, 1 ms

Traced with pmgr-pwrstate's dynamic debug: at the noirq suspend genpd
gates each port's usb domain, which was off at probe and so has no
GENPD_FLAG_ACTIVE_WAKEUP, and with it its parents, common and usb-aon,
whose own devices (the display crossbar's and the PHY's) have suspended.
Nothing sets the PHY up again at an s2idle wake.

DjDeveloperr noted that the usb-aon domains should not be turned off
("aon = always on"). The older SoCs (T8103, T8112, T600x, T602x) and
T604x mark them apple,always-on; T603x, T8122, T8140 and T8132 outside
the J713 do not, and neither did T6050.

Tested on the J714s: with only atc0/1/2's usb-aon marked always-on and a
PHY driver without any s2idle handling, genpd still gated atc*_usb and
atc*_common on all three ports during a 42 s s2idle and powered them on
again at the resume, but never touched usb-aon. After the wake a dock on
the right port came up in CIO mode at the first plug, with three
displays. With this patch's DTB, three s2idle sleeps in one boot (39 s,
102 s and 12 min) were each followed by a dock coming up in CIO mode at
the first plug on all three ports. Keeping usb-aon on is enough; gating
usb and common across s2idle is harmless.

Mark every T6050 usb-aon domain always-on. At runtime nothing changes
where the display crossbar holds the domain from its probe on, as on the
J714s (atc1, atc2) and the J716c (atc0 to atc2). On the other T6050
boards the crossbar is disabled, so a usb-aon domain used by a PHY went
off while its port was idle and now stays on (J714c, J716s, K114c,
K116s: atc1, atc2; J775c, J873s: atc1, atc3; J775d: atc1, atc3, atc4,
atc5), and an enabled usb-aon domain with no user is now powered at
probe (atc3 on the J714c, J716c, J716s, K114c, K114s, K116c and K116s;
atc1 on the K114s and K116c). The idle power this costs there, and the
PHY without a usb-aon power cycle on those boards, are untested. genpd
no longer gates usb-aon in a deep sleep's noirq phase either; the J714s
already keeps ATC3's on through the commit (t6050-j714s-sleep.dtsi), and
deep sleep cannot run on the J714s today, so that part is untested.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
@Isaac-Duarte
Isaac-Duarte force-pushed the j714s/phy-s2idle-domains branch from ad7f444 to 880491e Compare November 15, 2026 23:07
@Isaac-Duarte Isaac-Duarte changed the title phy: apple: atc-t6050: keep the PHY's domains through suspend-to-idle (J714s Type-C dead after s2idle) arm64: dts: apple: t6050: keep the ATC usb-aon power domains on (J714s Type-C dead after s2idle) Nov 15, 2026
@Isaac-Duarte
Isaac-Duarte force-pushed the j714s/phy-s2idle-domains branch from 880491e to 64d473f Compare November 15, 2026 23:14
@Isaac-Duarte
Isaac-Duarte marked this pull request as ready for review November 15, 2026 23:15
@Isaac-Duarte

Copy link
Copy Markdown
Contributor Author

@TripleU613 thank you for the report. It was the first test of the s2idle stack on a second J714s, and the first time anyone besides us saw USB-C working after a wake.

This PR has changed approach since you tested it. It no longer touches the PHY driver. It is now one device-tree commit, 64d473f532 "arm64: dts: apple: t6050: keep the ATC usb-aon power domains on": apple,always-on on the T6050 ATC usb-aon domains. Following DJ's note, a test here showed that keeping usb-aon on through s2idle is enough. Details are in the description.

If you can re-test with this version:

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

Note from our J714s kits: they carried the earlier version, and ran no s2idle

For the record, so nobody counts our runs as a test of this PR's current head:

  • Our display kits k1 to k6 today carried this PR at 0521255, the earlier PHY-side hold in atc-t6050-dp.c / atc-t6050-combo.h. They did not carry the current head, 64d473f (apple,always-on on the ATC usb-aon domains).
  • No s2idle was run in any of them. Each kit was booted once and read out only.

What those boots show for 0521255, at boot only:

  • Both Type-C ports came up:
    • the right port in USB4 with a Thunderbolt 5 dock (two DP tunnels, USB hubs, 2.5G Ethernet);
    • the left-front port in DP alt mode (a 3840x2160@120 display from k3 on).
  • No PHY errors: in k2b to k6, 0 start of mode ... failed, 0 CIO mode failed, 0 failed to place Type-C mux in safe mode.
  • Scope: the PHY's suspend-to-idle code isn't reached at boot. So this only shows that the earlier version didn't disturb the ports' normal bring-up.

Nothing on the current head from us: neither boot nor s2idle. TripleU613's report and your own runs are the evidence for it.

I haven't pushed anything to this branch.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merging under the owner's merge rule (the code reads right, and CI is green on 64d473f). For the record, our M5 Pro (J714s) runs today carried this PR's earlier PHY-side version (0521255), not this device-tree version. That kit lit all four of the owner's displays, and our default candidate built from it passed its boot checks. Both runs had sleep masked, so suspend-to-idle wasn't tried. Merge order, as the PR asks: #1647 → #1789 → this → #2012.

@DjDeveloperr
DjDeveloperr merged commit 7e5804f into aurora-silicon:integration/aurora Nov 16, 2026
2 checks passed
@TripleU613

Copy link
Copy Markdown
Contributor

Re-test with the reworked version, as you asked: it works on the second J714s too.

🤖 Generated with Claude Code

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