Repository navigation
arm64: dts: apple: t600x: mark the HDMI PHY domain sleep-wakeup-path - #3639
Conversation
The HDMI output's DCP keeps its firmware running through suspend-to-idle, and dcp_sleep_hold_phys() puts the output's DP PHY on the wakeup path so that the PHY's power domain stays up with the DCP's own. On t600x that domain is atc3_usb. It is off when the power controller probes, so it gets no GENPD_FLAG_ACTIVE_WAKEUP, and genpd powers it off in the noirq phase anyway. When the firmware next touches the PHY, the SoC hangs. On a MacBook Pro 14" M1 Pro (J314s) with an HDMI display attached, the first s2idle sleep after locking the session hung 6 times out of 6. It hangs when the devices are held suspended across the point about 30 s after the HDMI display was powered off, which the lock does: a pm_test=platform hold of 40 s right after the power-off hung 3 times out of 3, while a hold of 5 s, or of 40 s starting 40 s later, passed. With atc3_usb held, the 40 s hold passes and the lock-then-sleep sequence woke 5 times out of 5. Mark ps_atc3_usb apple,sleep-wakeup-path, as the t604x common_dp domains are. genpd holds the domain only while a device under it is on the wakeup path, so nothing changes without an HDMI link. Signed-off-by: Andreas Fernandez <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Verdict: MERGE at ae360ccafb3b
Blockers: None (clean two-line DT fix with matched J314s control-vs-patched hardware verification; approve and wait for fork PR dt-checks / readiness CI to complete green before merging).
Checked:
- Verified
arch/arm64/boot/dts/apple/t600x-pmgr.dtsi(L2168-2177): addsapple,sleep-wakeup-path;toDIE_NODE(ps_atc3_usb)(power-controller@e8), matching the documented property inDocumentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml(L184) and the existingt604x-pmgr.dtsiatc*_common_dppattern (c1c5e67258). - Verified
drivers/pmdomain/apple/pmgr-pwrstate.c(L978,L1068-1075):apple,sleep-wakeup-pathsetsGENPD_FLAG_ACTIVE_WAKEUPon a domain that is off at probe sogenpdholds it (and its parentps_atc3_common, alongsideapple,always-onps_atc3_usb_aon) durings2idleonly while a consumer (atcphy3int600x-dieX.dtsiL1071) is marked on the wakeup path bydcp_sleep_hold_phys(). - Verified no impact when HDMI is detached or during deep sleep (
s2r), and verified DCO sign-off and matched J314s (M1 Pro,T6000) control-vs-patched evidence (0/6hangs ->10/10wakes across 2 runs,40 spm_test=platformhold PASS,0atc3_usbtransitions during sleep,0HDMI DCP errors).
Evidence
Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yamlL184:apple,sleep-wakeup-pathis part of the schema.arch/arm64/boot/dts/apple/t600x-dieX.dtsiL1071 & L1078:atcphy3andatcphy3_xbarconsumeps_atc3_usb.arch/arm64/boot/dts/apple/t600x-pmgr.dtsiL2092: parentps_atc3_usb_aonisapple,always-on;, andgenpdkeeps parentps_atc3_commonpowered while active subdomainps_atc3_usbremains on.- Hardware table on J314s at
ae360ccafb3b: baselinemainhung 6/6 on lock+4 ss2idleand 3/3 on 40 spm_test=platform; patched passed 10/10s2idlewakes and 40 spm_test=platformhold with/sys/firmware/devicetree/base/.../power-controller@e8/apple,sleep-wakeup-pathconfirmed live. - Thank you for the thorough root-cause analysis and matched before/after testing!
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
What: On t600x the HDMI output's DP PHY sits in the
atc3_usbpower domain. The domain is off when the power controller probes, so genpd still powers it off in the noirq phase of s2idle, even thoughdcp_sleep_hold_phys()has put the PHY on the wakeup path. The HDMI DCP firmware keeps running through s2idle, and the SoC hangs the next time it touches the PHY. This marksps_atc3_usbapple,sleep-wakeup-path, as the t604xcommon_dpdomains already are.Tested: J314s M1 Pro at ae360cc (candidate ca1f32d30f on main 498d53f), HDMI display attached: boots; the first s2idle 4 s after a lock, then four more, woke 5 of 5 (on main, 6 runs of this sequence out of 6 hung in the first sleep). Same tree before sign-off: 5 of 5 again, and a 40 s pm_test=platform hold right after the display power-off passed (3 of 3 hung on main). No warnings or DCP errors that main does not also show.
Risk: two-way door · M1 Pro/Max/Ultra (t600x). It only changes anything during s2idle with an HDMI link up.
Not yet: the other t600x boards (J316s, J314c, J316c, J375c, J375d) have the same tree and were not run. t602x has the same layout (atcphy3 in
atc3_usb, no such property) and probably the same hang; I have no M2 Pro/Max to try it on, so it is not changed here. s2idle power with the domain held is not measured. A USB-C display on another port lost its link after the first sleep in the signed run; main did the same in one of two runs today, so it is not from this change, but it is not solved either.Details
The hang needs the devices to be suspended across a point about 30 s after the HDMI display was powered off. Locking the session powers it off, so the first sleep right after a lock is the one that hangs. A sleep 40 s or more after the lock woke every time, and so did every sleep with the HDMI cable out. The kernel log of a hung boot ends at
PM: suspend entry (s2idle).With pwrstate debugging on, a pm_test=platform sleep showed
atc3_usbcoming back on in resume_noirq, so it had been cut in suspend_noirq under the running firmware. With the domain held, the same sleep showed no transitions of it.pmgr-pwrstategivesGENPD_FLAG_ACTIVE_WAKEUPto a domain that is off at probe only when the node hasapple,sleep-wakeup-path(cc013c0), and the t604x domains got it in c1c5e67. No driver change is needed. Deep sleep (s2r) is not touched: the DCP's s2r suspend returns beforedcp_sleep_hold_phys(), so the PHY is not on the wakeup path there.On this Mac the device tree comes from stage 2 on the ESP, not from the kernel build. For the rows I booted the candidate kernel with this Mac's own J314s tree with only this property added;
/sys/firmware/devicetree/base/.../power-controller@e8/apple,sleep-wakeup-pathwas present on every boot.If you'd rather have this done another way, or also on t602x now, say so.
Evidence
Candidate ca1f32d30f = main 498d53f + ae360cc merged unchanged + one local commit outside this PR (the DRM driver name for the installed Mesa). The first two boots ran 17ff5f8e5e, the same tree with the commit before sign-off (ed25eaccc2).
atc3_usbtransitions during the sleep (main: cut in suspend_noirq, back on in resume_noirq).typec_altmode_update_activewarning (drivers/usb/typec/class.c:317) at a USB-C replug before the lock (usb: typec: take the altmode module reference when the mode is already active #3571 fixes it), and the USB-C display's DCP failing its DPTX reconnect after the first sleep (failed to validate DPTX target 0:1: -110, 32 lines over the five wakes).Before the fix, on main bc87129 and 6c869fd (no changes in pmgr-pwrstate, dcp.c, dcp-fabric.c, the PHY driver or t600x-pmgr.dtsi between 6c869fd and 498d53f):
atc3_usbheldThanks for taking a look!