Repository navigation
phy: apple: atc-t6050: keep the PHY's domains through suspend-to-idle (J714s Type-C dead after s2idle) - #2008
Closed
Isaac-Duarte wants to merge 1 commit into
Conversation
Isaac-Duarte
force-pushed
the
j714s/phy-s2idle-domains
branch
2 times, most recently
from
November 15, 2026 16:45
61048f4 to
9d4e8e6
Compare
This was referenced Nov 15, 2026
Isaac-Duarte
marked this pull request as ready for review
November 15, 2026 18:29
On the J714s both Type-C ports are dead after a suspend-to-idle wake. A
dock plugged in after it fails on either port before the PHY firmware is
reached:
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
and the port controllers then give up ("failed to place Type-C mux in
safe mode: -5"). The same dock comes up in CIO mode on both ports after a
fresh boot. It happened in two boots: in one the ports had not been used
before the sleep and both failed after it; in the other both had run in
CIO mode before it, and the right port, the only one tried, failed after
it.
The display crossbar holds each port's usb-aon and common domains from
its probe on, so those never switch off at runtime. genpd's noirq
suspend gates a domain once every member device has suspended, runtime
holds or not, so suspend-to-idle switches them off for the first time
since boot. No firmware runs at an s2idle wake to set them up again, and
the PHY has no s2idle callbacks: its cold start then times out in the
first power-up step (1 ms, one 1000 us poll).
Traced with the PHY module from before this change (pmgr-pwrstate and
genpd dynamic debug): at the noirq suspend genpd gates atc2_usb, then
atc2_common and atc2_usb_aon, then the same three for ATC1, and powers
all six on again at the resume; each domain's genpd usage goes from 0 to
1. The usb domain was off when genpd took it over, and the controller
powered it up after boot. So
pmgr-pwrstate did not give it GENPD_FLAG_ACTIVE_WAKEUP, and the dwc3
glue in it is counted as suspended although its wakeup is enabled. The
domain goes off once the glue, its DARTs and the PHY's device have
suspended, and common and usb-aon follow, their own devices (the
crossbar's and the PHY's) being suspended too. On a T8142 J813, whose
ATC domains were on at boot, dwc3's wakeup keeps them all on through
s2idle.
Hold the PHY's domain devices out of the system transition when the
sleep is suspend-to-idle, from the PM notifier's PM_SUSPEND_PREPARE to
PM_POST_SUSPEND, so that they cover the prepare and complete phases as
well. genpd then never counts a domain's devices all suspended, and each
domain stays as runtime PM had it: an idle port's wrapper off, its usb
domain as the USB controller holds it, the crossbar's on, a port in use
as it was. thunderbolt/apple uses the same syscore mark for its
router's domains, for a cable's lifetime.
The hold is in the PHY rather than the crossbar or the device tree: the
PHY is the device whose cold start needs the domains not gated since
boot, and it already has the J714s sleep notifier. Its other domains
(wrapper, usb, tunnel clocks) are held too, harmlessly: they stay as
runtime PM has them. apple,sleep-retained would apply to deep sleep as
well, where the PHY's own sleep handling decides what the always-on
domain keeps.
Suspend-to-idle was refused on the J714s until now, so this path has not
run there before. As with the PHY's deep-sleep notifier, this is in
force on the J714s only, where the notifier is registered. A
suspend-to-idle reached by writing "freeze" while "mem" means deep is
not covered: the notifier goes by the default sleep, as dwc3-apple's
does.
Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Isaac-Duarte
force-pushed
the
j714s/phy-s2idle-domains
branch
from
November 15, 2026 19:17
9d4e8e6 to
942cbbd
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One commit,
drivers/phy/apple/atc-t6050-combo.handatc-t6050-dp.c(+33/−3). It is in force on the J714s only.When the default sleep is suspend-to-idle, the T6050 combo PHY's existing PM notifier now holds every power domain device of the PHY out of the system transition: the four domains (
usb-aon,common,wrapper,usb) and thedp0..dp3tunnel-clock gates. Each is markeddev_pm_syscore_device()atPM_SUSPEND_PREPAREand released atPM_POST_SUSPEND, so the hold covers prepare through complete.thunderbolt/apple.cuses the same syscore mark for its router's domains, for a cable's lifetime.genpd then never sees all of a domain's devices suspended, so it leaves each domain as runtime PM had it. On an idle port:
usbdomain stays as the USB controller holds it (on in the snapshots);usb-aon/commonstay on.A port in use stays as it was.
The deep-sleep path (
aon_syscore,combo_suspend_late()and the rest) is unchanged. The new branch is taken only whenpm_suspend_default_s2idle().Why the PHY, not the crossbar or the DT:
The PHY is the device whose cold start needs these domains not gated since boot, and it already has the J714s sleep notifier.
Its other domains (wrapper,
usb, tunnel clocks) are held too, harmlessly: they stay as runtime PM has them.apple,sleep-retainedon the domains would apply to deep sleep too, where the PHY's own sleep handling decides what the always-on domain keeps.Giving
atc*_usbGENPD_FLAG_ACTIVE_WAKEUP, as the J813's domains have:power/wakeupstays enabled. Userspace, udev or TLP can turn that off, and the gating would come back.The PHY hold states the PHY's own requirement, whatever the wakeup policy.
Why
On the J714s, both Type-C ports are dead after an s2idle wake until a reboot. A dock plugged in after the wake fails on either port in the PHY's first power-up step, before its firmware is reached:
This was seen in two boots. In one, the ports had not been used before the sleep, and both failed after it. In the other, both had run in CIO mode before the sleep, and the right port, the only one tried, failed after it.
apple-display-crossbar.c, T8142 ops) takes each port'susb-aonandcommondomains at probe and never releases them, so they never switch off at runtime.stay_on). It gates a domain once all of its devices have suspended, so the first s2idle switches those domains off for the first time since boot.Traced in one failing run, with the PHY module from before this change and pmgr-pwrstate plus genpd dynamic debug (s2idle 12:04:42 to 12:05:46, then the dock on the right port).
During the noirq suspend:
0xfat the resume.atc*_usb_aongained the was-power-gated bit.start of mode 1 failed (-110).What made the domains go off:
atc*_usbwas off when genpd took it over (idle 4–5 ms at boot, usage 0); the controller powered it up later.GENPD_FLAG_ACTIVE_WAKEUPonly to a domain that is on at probe (pmgr-pwrstate.c ~1024). Soatc*_usblacks the flag. This is inferred from that rule plus the boot idle time; the flag was not read back.commonandusb_aonare its parent domains, and went off in the same cascade once their last subdomain still on (this one) went off. Their own devices, the crossbar's and the PHY's, had already been counted as suspended.Contrast with the J813 (T8142,
phy-apple-atc), reported by Thomas Glanzmann: there the ATC domains were on at boot, soatc*_usbhas the flag. dwc3's wakeup then keeps the whole chain on, and over a 9 h s2idle those domains never went off.Still open: what exactly the gated domains lose (state the boot loader left, or the PHY firmware in SRAM). The fix doesn't depend on it.
Context: s2idle is only reachable on the J714s with #1647 plus
apple,j714sinapple_pcie_check_adopted_s2idle()'s allowlist (local, not yet PR'd). Before those, every s2idle was refused, so this path never ran. This PR is a prerequisite for enabling s2idle on the J714s, and changes nothing until then: the notifier is registered onapple,j714sonly and acts only when the default sleep is s2idle.Tested
J714s (MacBook Pro 14" M5 Pro). Running kernel 7.3.0-b248cfe (integration/aurora b248cfe + 13 carried commits, #1647 and #1789 among them, plus the local allowlist line). On top: the identical patch e49cad0c6 (same diff as this head). In the first boot with the patch, a debug commit was also on top: it logs the hold/release and the PHY's power-up registers, and adds an opt-in cycle-and-retry, though neither its retry nor its timeout path ran. In the second boot with the patch, the clean module ran alone. Dock: Ugreen Thunderbolt 5, 3 displays.
thunderbolt-apple-nhi: refusing system sleep: a DP tunnel to an external display cannot be kept(-16)397e7396…, read from/sys/module/atc_t6050_dp/noteson that boot, since the log doesn't show it): three real s2idle sleeps on one boot (34 s, 39 s, 49 s), lid wakes. The dock went on the right port after each wake, and on the left-front port after the second and third.start of mode,CIO mode failedor sn201202x errors in the boot. After the second wake, the first plug on the right port hit an NHI PCIe tunnel activation failure (thunderbolt-apple-nhi 381f00000.nhi: 1:9: PCIe tunnel activation failed, aborting, then USB dropped). The dock was re-plugged until it came up: two more starts dropped too, and the displays came with the fourth. Seen once, not yet attributed.start of mode,CIO mode failed, sn201202x orPCIe tunnel activation failederrors after this wakeatc1/atc2_commonoratc1/atc2_usb_aonduring that sleep (pmgr-pwrstate dyndbg).tgt=f act=f)./sys/module/atc_t6050_dp/notes.Build: clean cherry-pick onto integration/aurora 580e911; there it builds (
M=drivers/phy/apple, LLVM, W=1, no warnings). checkpatch: one line over 75 characters, a quoted log line in the commit message.Not tested / open questions:
mem_sleepofferss2idleonly). The deep path is untouched by this commit; a check once deep sleep runs is a follow-up.usb-aon/commonstaying on through s2idle, as they are when awake: not isolated. The whole system drew 1.95 W over the 57 min sleep (PCI: apple: suspend-to-idle on the J714s (adopted N1 link; stacks on #1647) #2012).To run before merge