Repository navigation
arm64: dts: apple: t6050: keep the ATC usb-aon power domains on (J714s Type-C dead after s2idle) - #2018
Conversation
0521255 to
ad7f444
Compare
|
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 |
|
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 |
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>
ad7f444 to
880491e
Compare
880491e to
64d473f
Compare
|
@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, If you can re-test with this version:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
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-onon 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, 0CIO mode failed, 0failed 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.
|
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. |
7e5804f
into
aurora-silicon:integration/aurora
|
Re-test with the reworked version, as you asked: it works on the second J714s too.
🤖 Generated with Claude Code |
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-onon every T6050 ATC usb-aon power domain, five lines in four files.t6050-peripherals.dtsit6050-dieX.dtsit6050-die0.dtsit6050-ultra.dtsiThe 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 ownapple,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:
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_commonandatc2_usb_aon, then the same three for ATC1. All six came back to 0xf at the resume, and the plug then failed.atc*_usbwas off when genpd took it over (idle 4–5 ms at boot). pmgr-pwrstate givesGENPD_FLAG_ACTIVE_WAKEUPonly to a domain on at probe, so it lacks the flag, and the wakeup-enabled dwc3 glue in it counts as suspended.commonandusb-aonfollowed in the same cascade, because their own devices (the display crossbar's and the PHY's) had already suspended.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:
usbandcommonstill 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:
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.atc*_usbandatc*_commonwent 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.display routedin the boot, 20 of them after sleeps 2 and 3. Nostart of mode,CIO mode failed, sn201202x or tunnel-activation errors. With pmgr dyndbg on during sleep 2:usbandcommonof atc0/1/2 each went 0x0 once and back, andusb_aonwas 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_regon/soc/pmp@284e00000,unit_address_vs_regon 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:
mem_sleepofferss2idleonly).&ps_atc{0,1,2}_usb_aon { apple,always-on; };int6050-j714s.dts) is the fallback.usbandcommonnow go off in s2idle, so the draw may be lower.To run before merge
History
9d4e8e61899e, later942cbbd0/ab0a7235) carried a PHY-side fix. During s2idle it held all of the PHY's power domain devices out of the system transition, as syscore devices. GitHub closed phy: apple: atc-t6050: keep the PHY's domains through suspend-to-idle (J714s Type-C dead after s2idle) #2008 after a bad force-push (a parentless commit).05212557and thenad7f44429aab. That hold fixed the failure, but it also keptusbandcommonon, and it lived in one driver for one board.ad7f44429aab) on a second J714s (comment below), with PCI: apple: suspend-to-idle on the K116s (adopted N1 link, kernel-trained SD reader port) #1647, PCI: apple: suspend-to-idle on the J714s (adopted N1 link; stacks on #1647) #2012 and arm64: dts: apple: t6050: keep the PMP's power domains on (PMP crash after s2idle) #1789. Two lid s2idle cycles were clean, and after the wake a charger and a USB device worked on the left-front and right ports. Thank you; a re-test with this version is welcome.