Skip to content

arm64: dts: apple: t6050: keep the ATC USB power domains on in system sleep - #2592

Closed
satchlj wants to merge 1 commit into
integration/aurorafrom
satchlj/t6050-atc-usb-retain-20261120
Closed

satchlj wants to merge 1 commit into
integration/aurorafrom
satchlj/t6050-atc-usb-retain-20261120

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

arm64: dts: apple: t6050: give the four ATC USB power domains (ps_atc0..3_usb, and die 1's ATC1 on the Ultra) apple,always-on, so system sleep doesn't power them off. That also keeps their AON and common parents on. The tip already keeps the atcN_usb_aon domains on, because "the ATC PHY loses its state without it".

Selector: the SoC DT (t6050-peripherals.dtsi, t6050-dieX.dtsi, t6050-die0.dtsi). Every T6050 board gets it, and no driver code changes.

Base: integration/aurora df62a8c4d38d.

Why

On J775c, a suspend-to-idle that powers these domains off never comes back. With #2488's head and #2557, the host's D0 check now passes. Resume then hung in the noirq phase, with no wake source involved (pm_test=platform). Ftrace probes in the stall dump showed genpd_resume_noirq entered and never returned for:

  • 38a280000.usb;
  • two ACIO domains;
  • the ATC PHY 2a3000000.phy domains.

lobata's working J775c kernel keeps these same four domains on for system sleep (e1c71b143557 there). That kernel passes real s2idle cycles. Its comment gives the reason as the USB DARTs having no power-down path in the T8110 backend. I haven't checked that against today's apple-dart.c, which has more suspend handling, so this PR states only what's observed.

Testing (J775c, lobata)

Kernel: cand-10, 6ebd4f505fd5 = integration/aurora df62a8c4d38d (this PR's base) + 84. It carries #2488's head, #2557, #2556 and #2565. The J775c DT is #2102's board file, with apple,always-on added to atc0-usb, atc1_usb, atc2_usb and atc3_usb, the same change as this PR. The command line adds no_console_suspend initcall_debug. Entered by an ordinary reboot as a one-shot.

Run Without the retention (cand-8, cand-9: same composition on older bases) With it (cand-10)
pm_test=platform hangs in noirq resume (RCU stall; DebugUSB reset or power cycle needed) PM: suspend entry (s2idle) … apple_pcie_suspend_noirq returned 0 … suspend debug: Waiting for 5 second(s) … PM: suspend exit, rc 0, with pm_async=0. Every genpd_resume_noirq returns, including the ACIO, ATC PHY and USB domains.
rtcwake -d rtc0 -m freeze -s 30, ×3, pm_async=1 didn't resume (cand-7) 3/3 resumed, each after 32 s, rc 0, /sys/power/pm_wakeup_irq = 151 (macsmc-rtc through apple_spmi), RTC IRQ count 0→1→2→3. No D0 refusals.

Static checks: CHECK_DTBS reports no warnings for every T6050 board (j714c, j714s, j716c, j716s, j775c, j775d, j873s, k114c). J775c's DTB has apple,always-on on its 4 ATC USB domains, and J775d's on 5 (atc0–atc3, plus die 1's atc5_usb).

Idle (regression check, the only idle measurement): 7.935 W on the same cand-10 boot, against 8.582 W on lobata's default (Shelly, 20 steps; details in the comment below). This doesn't measure held-on against powered-off on the same kernel.

Untested:

  • boards other than J775c;
  • a USB-C/Thunderbolt device in use across the sleep.

🤖 Generated with Claude Code

… sleep

On J775c, a suspend-to-idle that powers the four ATC USB domains off
does not come back: resume hangs in the noirq power-on of the USB-C
domains (the dwc3 USB, ACIO and ATC PHY domains), with an RCU stall and
no wake source involved (pm_test=platform). With these domains kept on,
pm_test=platform resumes and three real suspend-to-idle cycles complete,
each woken by the RTC alarm.

lobata's working J775c kernel keeps the same four domains on for system
sleep. Keeping them on also keeps their AON and common parents, which
the wake path needs, powered.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: J775c idle-power regression check with this change: not worse than the default.

  • Kernel: the same cand-10 boot as the s2idle rows (6ebd4f505fd5 = df62a8c4d38d + 84, with this change in the J775c DT).
  • Method: wall power from a Shelly plug, step-timed over 20 counter steps of 0.119 Wh. The display is in its idle state and nothing runs; the default kernel was measured the same way.
Kernel Idle wall power
lobata's default J775c kernel (keeps the same domains on) 8.582 W
cand-10 with this change 7.935 W (20 steps over 1081 s; 7.72–8.07 W per step; no meter freeze)

So holding the four ATC USB domains on costs nothing measurable against the default here. This is only the "nothing worse" check; I haven't measured the domains held on vs off on the same kernel.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

The change is safe at runtime today: on T6050 dwc3-apple doesn't runtime-suspend (idle_rpm is set only for the t6040 and t8132 compatibles, dwc3-apple.c:2033), so these domains already stay up while the machine runs, and apple,always-on only changes the system-sleep case. That fits the idle row.

One design question: what this needs is "not powered off during system sleep", which is what apple,sleep-retained does (pmgr-pwrstate.c:442; runtime PM unaffected, already used for the T6050 GPU). apple,always-on also pins the domains at runtime, so if dwc3 idle runtime PM is later enabled for t6050 as it is for t6040, the laptops (J714s/c, J716s/c) would keep all four ATC USB domains up without saying why. If always-on is wanted on purpose, to keep the AON/common parents up at runtime too, a word on that in the comment would help. Otherwise sleep-retained looks like the closer fit.

It would also be good to see one s2idle run on J775c with a USB device in use across the sleep (a mounted drive read before and after), since that is listed as untested.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf

On RyanTheTide's question (apple,sleep-retained instead of apple,always-on), J775c rows from today on the #2498 open-PR stack with its stock DTB (platform timer, direct-peer NHI unbound, one boot per arm, same diagnostic Image, only the DTB changed):

DTB change Result
none SError at the ATC1 PHY's first CIO shutdown read (bank 2 0x120) after suspend exit. At that read the PHY's four domains read active in PMGR and ACIO's atc1-cio* domains read off.
atc1-cio apple,always-on same SError at the same read
atc1_usb apple,sleep-retained no SError. The full CIO lane shutdown ran (the atc1-cio* domains were off), then the PHY firmware stop returned -62, which also happens with apple,always-on. genpd counted one refused power-off of atc1_usb across the cycle.

So on J775c, keeping atc1_usb on only through system sleep is enough for this failure. That supports the narrower property.

Real RTC row, same stack, apple,sleep-retained on all four ATC USB domains (one boot): 3/3 rtcwake -m freeze -s 10 cycles returned (counters 1/0, 2/0, 3/0). With the stock DTB this stack returned from 0 of 1. HDMI came back connected and enabled within about 1 s each time, with 0 setmode failed, no SError and 0 failed units. Each ATC USB domain counted 3 refused power-offs. The Thunderbolt peer did not come back after the cycles; that is a separate XDomain issue this stack doesn't carry the fix for.

Before I switch this PR to apple,sleep-retained, I want to confirm the mechanism rather than paper over it. One refused power-off doesn't show that the PHY lost state, and a DT policy could be hiding an ordering problem between the PHY and ACIO. Still to do:

  • alternate stock and retained DTBs over several cycles each;
  • read a configured PHY register before sleep and after resume;
  • decide whether the PHY driver should re-initialise after its USB domain power-cycles, or declare the dependency.

All rows above used a diagnostic serial-console cmdline; the validation rows will use the default one. Separately, the PHY firmware stop returns -62 at the mux's safe-mode switch with either property. That's a second fault, which I'll track on its own.

#2592

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: trailer-only rewrite, removed Co-Authored-By from 1 commit(s); same trees, Signed-off-by kept (437d9e8 -> a142752, --force-with-lease).

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J714s (Apple M5 Pro / T6050) combined-stack s2idle + deep hardware row: PASS

  • Exact tested stack: base cc145705c592 + #2007 (36ef4f8b60cf, incl. #1743) + #2592 (a142752404ed) + #2557 (f90f377c8c5e) + #2664 (6fb5e78f9b46) + #2739 (075bd14d3dec, T6050 PCIe-C s2idle_hold_domain), rebuilt t6050-j714s.dtb (1fbcc4fe2c55, MTE enabled; no_console_suspend ignore_loglevel appended for serial capture; Dell Thunderbolt dock attached with active PCIe-C tunnel + USB3/DP).
  • s2idle (rtcwake -d rtc1 -m freeze -s 15): 3/3 PASS (asleep 14.5 s / 14.0 s / 14.6 s, rtc_delta=20 s each, macsmc-rtc IRQ 118 0 -> 1 -> 2 -> 3, pciec_ebusy=0, refusal=0, disp=3/3, usb=20, wifi=1, bt=1, nvme=1, aer=0, link_err=0, gpu_lost=0).
  • deep regression (rtcwake -d rtc0 -m mem -s 15): 1/1 PASS (asleep=13.1 s, rtc_delta=23 s, refusal=0, disp=3/3, usb=20, wifi=1, bt=1, nvme=1, aer=0, gpu_lost=0).
  • Regression line: suspend_stats success=0 -> 4, fail=0; GPU LIVE (vulkaninfo + compute dispatch) pre/post; 0 kernel oops/WARN, 0 DART faults, 0 SELinux AVCs, 0 new failed systemd units (only pre-existing offline tailscaled.service).
  • Scope note: Combined-stack J714s verification (not isolated from the other four s2idle PRs listed above).

Assisted-by: LLM (Gemini 4 Neon)

@satchlj
satchlj force-pushed the satchlj/t6050-atc-usb-retain-20261120 branch from a142752 to 5ee36b9 Compare November 21, 2026 21:53
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: added the missing Signed-off-by: Satya Benson to 1 commit(s); same trees, nothing else changed (a142752 -> 5ee36b9, --force-with-lease).

@satchlj

satchlj commented Nov 21, 2026 •

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf

Closing in favour of #2664 (#2664).

Why. On J775c the failure this PR addressed is not a missing DT policy:

  • On suspend-to-idle the ACIO driver keeps the USB4 port up, so the ATC PHY stays in CIO mode.
  • genpd then gates the PHY's USB domain in noirq.
  • The PHY's core bank is unreachable right after resume (an SError on its first read), even though PMGR reports the domain on.

#2664 holds the PHY's active domains out of genpd during suspend-to-idle, on every T6050 combo PHY, with no DT property and no board list. apple,sleep-retained here only hid that, and with it the PHY's firmware stop still failed (-62, then mux safe-mode -5).

Rows. Stock J775c DTB, with none of this PR's properties:

without #2664 with #2664
pm_test=platform, 3 cycles (diagnostic console cmdline) SError at the first CIO-shutdown read (0x2ab000120), 2 s after resume 3/3, no SError, no safe-mode lines
real rtcwake -m freeze -s 10 ×3 (default cmdline plus our helper's arm64.nomte) did not return from the first cycle (no RTC line after it; recovered by a mains cycle) 3/3; HDMI back each cycle; end0 up; PCIe noirq 0/0; 0 SELinux denials, 0 failed units

Thanks @RyanTheTide for the apple,sleep-retained question; it led to the PHY reads that found this.

Evidence size. One boot per row. Without #2664 the fault reproduced on both bases:

  • the platform SError on a84637dca209 (several boots) and on the current tip (one boot);
  • real RTC returned from 0 of 1 cycles on each base.

With #2664: 3/3 platform and 3/3 real RTC cycles on each base, one boot per row. The tip rows carry the helper's arm64.nomte, and the tested stack needed one adjacency resolution between #2102 and #2557 in pcie-apple.c (both new functions kept unchanged).

@satchlj satchlj closed this Nov 21, 2026
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