Skip to content

arm64: dts: apple: t6050: give the ATC COMMON states their fabric parents - #2766

Open
satchlj wants to merge 2 commits into
integration/aurorafrom
satchlj/t6050-atc-common-parents-20261122
Open

satchlj wants to merge 2 commits into
integration/aurorafrom
satchlj/t6050-atc-common-parents-20261122

Conversation

@satchlj

@satchlj satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

arm64: dts: apple: t6050: give atc1-common its fabric parent fab3-soc, and atc2-common / atc3-common theirs, fab5-soc. Only atc0-common had one. The links come from the ADT's PMGR device table on J775c (Mac Studio, M5 Max). This is SoC topology, so it goes in t6050-peripherals.dtsi for every T6050 board, with no board or SoC selection.

ADT PMGR device ADT parent This tree before
ATC0_COMMON FAB3_SOC fab3-soc
ATC1_COMMON FAB3_SOC none
ATC2_COMMON FAB5_SOC none
ATC3_COMMON FAB5_SOC none
FAB3_SOC, FAB5_SOC FAB0_PIOGW fab0-piogw (matches)
SBR FAB3_SOC fab3-soc (matches)

Why it matters: while a port's combo PHY domains stay powered through suspend-to-idle (#2664 holds the active ones), genpd sees no powered child under fab3-soc and asks for it to go off. The PMGR refuses and keeps it on. Every s2idle on J775c then logs:

PS fab3-soc: bring-up target never landed after 1 attempts (write swallowed; last readback 0x1f0003ff)
PS fab3-soc: Failed to reach power state 0x0 (requested 0xf0000f0, now: 0x1f0003ff)

The first line comes from the readback check in apple_pmgr_ps_verify_bringup(). The write it reports is a power-off the hardware refused, not a bring-up.

Testing

J775c, the lobata candidate kernel cand-13 (integration/aurora 606d37ec plus lobata's open PRs, including #2664), default cmdline, one-shot trial boots, 3 × rtcwake -m freeze -s 10.

DTB genpd children of fab3-soc / fab5-soc fab3-soc errors After each wake
without this change (boot 17245fda) atc0-common / none 1 per suspend, 3/3 USB 6, end0 up, ping OK, HDMI connected
with it (boot 925b84e9) atc0-common, atc1_common / atc2_common, atc3_common 0/3 USB 6, end0 up, ping OK, HDMI connected
  • 0 failed units on both boots.
  • Kernel error lines go from 17 to 11, which is the six fab3-soc lines removed.
  • The sync_state() pending notices for the four ATC COMMON states are the same on both boots.
  • The candidate's J775c DTS is flattened, so the trial DTB carries the same three links there; this PR edits the shared dtsi.
  • All 11 t6050-*.dtb build on 606d37ec with this commit, and the J775c DTB carries the three power-domains.
  • checkpatch --strict: clean.
  • Not covered:
    • J775d's second die: the ADT read is J775c's, and the die-1 ATC states are left as they are.
    • Other T6050 boards on hardware.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

…ents

The PMGR device table in the ADT gives every ATC port's COMMON state a
fabric parent. ATC0_COMMON and ATC1_COMMON hang off FAB3_SOC, and
ATC2_COMMON and ATC3_COMMON off FAB5_SOC. Only atc0-common had its parent
here.

Without the other links, genpd counts no powered child under a fabric
while a port's PHY domains stay on, and it asks for the fabric to go off.
The PMGR refuses the write. On J775c this happens at every
suspend-to-idle while the ATC1 combo PHY is active:

  PS fab3-soc: Failed to reach power state 0x0 (requested 0xf0000f0,
  now: 0x1f0003ff)

Describe the missing parents.

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

Copy link
Copy Markdown
Contributor

The topology is right (it's the ADT's PMGR table) and it belongs in the shared dtsi. As written, though, it breaks ports on boards that are not the J775c candidate:

  • ps_fab3_soc and ps_fab5_soc are status = "disabled" in t6050-peripherals.dtsi, and no in-tree board enables ps_fab5_soc (only the J716c USB4/sleep dtsi enable ps_fab3_soc). With a disabled parent there is no genpd provider, so of_genpd_add_subdomain() returns -EPROBE_DEFER in apple_pmgr_ps_probe() (pmgr-pwrstate.c:1066-1070), and the child never registers.
  • The J716s, K114c and K116s trees enable ps_atc2_common. With this commit it gets ps_fab5_soc as its parent and defers forever, and so does everything under ATC2. The J714s already ran into this: t6050-j714s-left-back.dtsi deletes ps_atc0_common's fab3 parent for this reason, noting that enabling the fabric would hand it and its undescribed users to genpd's unused power-off.
  • Your J775c rows ran a flattened candidate DTS that carries more than this commit (it enables the fabrics), so they don't show the in-tree behaviour.

Two ways out: add the parent only where the board also enables the fabric (and mark the fabric apple,always-on there, so its undescribed users keep it up), or enable ps_fab3_soc/ps_fab5_soc as always-on in the shared dtsi together with these links. The second keeps the links SoC-wide and still stops the refused power-off, since genpd never turns an always-on domain off. Either way, a boot of J716s or K114c on this head showing ATC2 probing (no devices_deferred entries) is needed, plus the J775c on the in-tree DTB rather than the flattened one.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Follow-ups on scope, idle behaviour and the error counts.

Idle check. Same J775c, same kernel (cand-13), the DTB without and then with this change. genpd state 60 s after boot and 30 s after one 10 s rtcwake -m freeze, plus SMC DC input power at each point:

without (boot 3cf21793) with (boot fc673401)
fab5-soc in genpd not registered registered, on (children atc2_common, atc3_common)
atcN_common at idle all on: each port's USB host (atcN_usb on) all on
atc2/3 CIO and phymxwrap off-0 off-0
DC input, idle / after s2idle 10,838 / 10,575 mW 10,830 / 10,538 mW
fab3-soc errors after the s2idle 1 0
  • With USB up on all four ports, every COMMON state has a powered child, so fab5-soc stays on in both cases. Here genpd now knows why.
  • No idle power change within the sensor's resolution.
  • A machine whose ports drop their USB hosts would let genpd turn fab5-soc off. That isn't covered here.

Error-line accounting: both pairs drop exactly the six fab3-soc lines (two per suspend).

  • Checklist (3 × s2idle):
DCP lane-count DCP clock-index speakers off fab3-soc Total
without 4 4 1 6 15
with 4 4 1 0 9
  • Description's probe (3 × s2idle plus two DPMS off/on cycles): 5 + 5 + 1 + 6 = 17 without, and 11 with. The DPMS cycles add one DCP lane-count and clock-index pair.

Scope:

  • The only T6050 ADT I have is J775c's. There are no J714s, J716c or J775d dumps on disk.
  • The links sit in the shared dtsi because the PMGR states are SoC-level, but they were read on one machine.
  • J775d's second die is unchanged.

Not run: the error on the tip without #2664. On this machine a kernel without #2664 hung at its first s2idle (the ATC1 path #2664 fixes), so that comparison needs #2664.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

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

Adversarial review at 7629795f8a2c against pre-pr-checklist.md:

Blockers

  1. §3 (Critical DT regression — permanent -EPROBE_DEFER on in-tree T6050 boards):

    • In arch/arm64/boot/dts/apple/t6050-peripherals.dtsi:131-150, ps_fab0_piogw, ps_fab3_soc, and ps_fab5_soc are all status = "disabled".
    • On integration/aurora, zero in-tree boards enable ps_fab5_soc, and only t6050-j716c-left-usb4.dtsi:1278 enables ps_fab0_piogw and ps_fab3_soc (with t6050-j716c-sleep-full.dtsi:4396 marking ps_fab3_soc apple,firmware-owned).
    • Meanwhile, ps_atc1_common (t6050-dieX.dtsi:50) and ps_atc3_common (t6050-die0.dtsi:860) are enabled by default across T6050 boards, and ps_atc2_common is enabled on J716s (t6050-j716s.dts:400), K114c (t6050-k114c.dts:452), K116s (t6050-k116s.dts:313), and Max boards (t6050-max-atc2.dtsi:22).
    • Adding power-domains = <&ps_fab3_soc> / <&ps_fab5_soc> in shared t6050-peripherals.dtsi while those parents remain disabled causes of_genpd_add_subdomain() in apple_pmgr_ps_probe() (drivers/pmdomain/apple/pmgr-pwrstate.c:1066-1070) to return -EPROBE_DEFER, jump to err_remove, remove the child provider, and defer forever — breaking ATC1, ATC2, and ATC3 and all downstream USB/CIO/PCIe/PHY consumers on in-tree T6050 boards.
    • Note also t6050-die0.dtsi:859 ("FAB5_SOC (+0x1f0) is critical: always on"), t6050-j714s-left-back.dtsi:24-32, and t6050-j716c-sleep-full.dtsi:4393-4398: if enabling ps_fab0_piogw/ps_fab3_soc/ps_fab5_soc in the shared dtsi alongside these parent links, mark the fabrics safely (apple,always-on or apple,firmware-owned) so genpd cannot power them off underneath undescribed fabric consumers; otherwise scope the parent links to trees that enable those fabrics safely.
  2. §5 (Hardware verification on in-tree DTB missing):

    • The J775c runs used an out-of-tree flattened candidate DTS that already enabled the fabrics, which masked the in-tree -EPROBE_DEFER failure above.
    • Please re-verify on an in-tree DTB (J775c plus at least one other T6050 board such as J716s or K114c) showing zero devices_deferred entries for ATC1/ATC2/ATC3, plus report the SELinux denial count (0 required by §5).

Checks Passing

  • §1 / §2 / §4 / §6: SoC-level DT topology matches ADT, human author/committer and human Signed-off-by: only, Assisted-by: present in PR body, clean naming, CI dt-checks and host-tests green.

Assisted-by: LLM (Gemini 4 Neon)

… from on

The previous commit gives ATC0/1_COMMON the FAB3_SOC state and
ATC2/3_COMMON the FAB5_SOC state as parents, as the ADT's PMGR table
does. Both fabric states and their own parent, FAB0_PIOGW, were
disabled in this file, and no in-tree board enables FAB5_SOC. A
disabled parent registers no genpd provider, so of_genpd_add_subdomain()
in apple_pmgr_ps_probe() returns -EPROBE_DEFER and every enabled ATC
COMMON state, and everything below it, defers for good on those boards.

Describe the three states as the boards that already use them do:
FAB0_PIOGW firmware-owned (J714s, J716c, K116s set exactly this), and
FAB3_SOC and FAB5_SOC always-on. The fabrics also carry users that are
not described, so genpd must never turn them off; always-on keeps them
as the boot loader leaves them while giving the COMMON states a parent
that probes. A board that marks FAB3_SOC firmware-owned (J716c's sleep
tree) keeps that, since firmware-owned takes precedence.

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

Copy link
Copy Markdown
Contributor

Thanks, ada78ff fixes the deferral: with ps_fab0_piogw, ps_fab3_soc and ps_fab5_soc enabled in t6050-peripherals.dtsi:125-153, every T6050 board (all 11 include that file) now has a provider for the new parents, and GENPD_FLAG_ALWAYS_ON means genpd never powers the fabrics off, so their undescribed users are covered. J716c's sleep tree keeping fab3 firmware-owned still wins (pmgr-pwrstate.c:997 before :1007). J775d's die 1 is unchanged and has no parents to wait for.

Remaining:

  • apple,always-on is not quite "as the boot loader leaves them". For a domain that is not firmware-owned, the driver still writes the register: at probe it sets AUTO_ENABLE and clears the WAS_* flags (pmgr-pwrstate.c:1038-1040), or turns it on if it reads off (:1007-1025). After every firmware-driven suspend, apple_pmgr_ps_resume_noirq() (:635-671) also rewrites target ACTIVE + AUTO_ENABLE if the sleep left it otherwise, and logs "resync after sleep failed" if the PMGR refuses. J714s and J716c both run that suspend. t6050-j716c-sleep-full.dtsi:4391-4398 notes FAB3_SOC is hardware-owned and marks it apple,firmware-owned for that reason. Marking fab3 and fab5 firmware-owned here, like fab0, keeps the subdomain links and the always-on vote (:997-999) and never touches the register. Otherwise a J714s or J716c suspend/wake on this head without a resync error for fab3-soc/fab5-soc would settle it.
  • t6050-j714s-left-back.dtsi:24-27 is stale now. ATC1 and ATC2 do get parents, and an enabled fab3 is no longer handed to genpd's unused power-off. Reword it, or drop the /delete-property/ (ATC0 is disabled there anyway).
  • Testing: there is still no row at this head on the in-tree DTB. Please add the J775c on the in-tree t6050-j775c.dtb, plus one of J716s or K114c showing the ATC2 states probe (no devices_deferred entries). The description also needs updating for the second commit.

Assisted-by: LLM (Claude:Opus 5.5)

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

Adversarial re-review at ada78ffa7b66f12c308d6076b5a419b8517f2fa8 against pre-pr-checklist.md:

Prior Blockers Resolved

  • §3 (Disabled parent -EPROBE_DEFER): Commit ada78ffa enables ps_fab0_piogw, ps_fab3_soc, and ps_fab5_soc in shared arch/arm64/boot/dts/apple/t6050-peripherals.dtsi, resolving the missing genpd provider deferral on all 11 T6050 board DTs.

Blockers

  1. §3 (DT safety regression — apple,always-on vs apple,firmware-owned on hardware-owned ps_fab3_soc / ps_fab5_soc):

    • ada78ffa marks ps_fab3_soc and ps_fab5_soc as apple,always-on (claiming "always-on keeps them as the boot loader leaves them"), unlike ps_fab0_piogw (apple,firmware-owned).
    • In drivers/pmdomain/apple/pmgr-pwrstate.c, apple,always-on does not leave the PMGR register untouched:
      • At probe (pmgr-pwrstate.c:1007-1025, 1038-1040), non-firmware-owned domains still write APPLE_PMGR_AUTO_ENABLE and clear APPLE_PMGR_FLAGS (or write APPLE_PMGR_PS_ACTIVE if read off).
      • After every firmware-driven suspend (apple_pmgr_ps_resume_noirq(), pmgr-pwrstate.c:642-671), ps->firmware_owned is skipped whereas apple,always-on actively rewrites APPLE_PMGR_PS_ACTIVE | APPLE_PMGR_AUTO_ENABLE and logs resync after sleep failed if PMGR refuses.
    • As documented in arch/arm64/boot/dts/apple/t6050-j716c-sleep-full.dtsi:4391-4398, FAB3_SOC is an ADT no_ps hardware-owned domain ("the hardware owns its state ... leave it to the hardware, as FAB0_PIOGW"). Neither t6050-j714s.dts (for ps_fab3_soc and ps_fab5_soc) nor t6050-j716c-sleep-full.dtsi (for ps_fab5_soc) overrides these to apple,firmware-owned, even though both run firmware-driven sleep and mark other shared fabrics (ps_fab0_piogw, ps_fab1_piogw, ps_fab7_soc, ps_fab8_soc) apple,firmware-owned.
    • Switching ps_fab3_soc and ps_fab5_soc to apple,firmware-owned gives the exact same GENPD_FLAG_ALWAYS_ON + active = true genpd state (pmgr-pwrstate.c:997-999) and subdomain links while ensuring Linux never touches their PMGR registers at probe or firmware-sleep resume. (Alternatively, prove firmware-driven suspend/resume on J714s/J716c with zero resync errors for both fabrics.)
    • (Hygiene) Please also update or clean up the now-stale comment and /delete-property/ power-domains; on &ps_atc0_common in arch/arm64/boot/dts/apple/t6050-j714s-left-back.dtsi:23-32.
  2. §5 (In-tree DTB hardware verification still missing):

    • Still no boot result at ada78ffa using the in-tree t6050-j775c.dtb (existing runs are on the out-of-tree flattened candidate DTS), no boot on another T6050 board (e.g. J716s or K114c) showing ATC2 probing with zero devices_deferred entries, and no explicit SELinux denial count (0 required by §5). Please also update the PR description to cover commit ada78ffa.

Checks Passing

  • §1 / §2 / §4 / §6 / CI: SoC-level DT topology matches ADT, both commits (7629795f, ada78ffa) carry human author/committer and human Signed-off-by: only, Assisted-by: present in PR body, clean naming, dt-checks and host-tests green at ada78ffa.

Assisted-by: LLM (Gemini 4 Neon)

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Reply to the two reviews of 7629795f (the permanent -EPROBE_DEFER on boards with the fabric states disabled). Fixed in a new commit, ada78ffa.

The fix

  • t6050-peripherals.dtsi now describes the three states as the boards that already use them do:
    • ps_fab0_piogw: apple,firmware-owned, okay. This is exactly what J714s, J716c-sep and K116s set.
    • ps_fab3_soc and ps_fab5_soc: apple,always-on, okay.
  • This is the second way out @RyanTheTide named, and the always-on / firmware-owned marking @DjDeveloperr asked for. The parent links stay SoC-wide, every ATC COMMON state gets a parent that probes, and genpd never turns a fabric off under its undescribed users.
  • Overrides: where a board marks a state firmware-owned and the dtsi now also says always-on (J716c's sleep tree on ps_fab3_soc), apple_pmgr_ps_probe() takes the firmware-owned branch first (pmgr-pwrstate.c: firmware_owned → GENPD_FLAG_ALWAYS_ON, active; the always-on branch is skipped for firmware-owned states). So that board keeps its behaviour.

Build check, all 11 T6050 DTBs

  • I decompiled each DTB and listed every enabled power state whose power-domains parent is disabled. That is exactly what defers in apple_pmgr_ps_probe().
J714c, J714s, J716s, K114c, K116s J716c J775c, J775d, J873s, K114s, K116c
7629795f atc1/2/3_common atc2/3_common atc1/3_common
ada78ffa none none none
  • One more entry appears in both columns and is unrelated: pmp-gfx → gfx. It is already present at 7629795f and untouched here.
  • dtc: 0 warnings.
  • dtbs_check (dtschema 2026.9) on the T6050 DTBs: the same 28 lines before and after, none on these nodes.

Why my J775c rows passed on 7629795f. They ran the candidate's flattened J775c DTS, whose carry 4d7b88fd adds only the three power-domains links.

  • The file: in the DTB that row armed (b35a7f58, decompiled), fab5-soc is status = "disabled"; fab0-piogw and fab3-soc are okay.
  • The helper: lobata's trial helper copies the DTB unchanged.
  • The live tree: on a boot of that same DTB (e5e94f0f), /proc/device-tree reads status = "okay" for fab0/fab3/fab5. genpd lists fab5-soc with children atc2_common and atc3_common, and devices_deferred is empty.
  • So lobata's boot loader enables the fabric states at handoff. That hid the defer: with a loader that doesn't, it happens exactly as described.

In-tree DTB rows. Not possible on J775c today.

J775c runtime row with the fix's properties.

  • Setup: lobata's cand-16 kernel (Image d6dbf747) and carry DTB 0442bec2, which sets fab0-piogw firmware-owned and fab3/fab5 always-on, all okay. Default cmdline, boot e61b0444.
  • Live DT: fab0-piogw okay and firmware-owned; fab3-soc and fab5-soc okay and always-on.
  • genpd: fab0/fab3/fab5 all on. Children of fab3-soc: atc0-common, atc1_common. Children of fab5-soc: atc2_common, atc3_common.
  • devices_deferred: empty.
  • Devices: 6 USB devices, all four Type-C ports, thunderbolt0 up.
  • One 12 s rtcwake -m freeze: rc 0, everything still on afterwards.
  • 0 failed units, 0 AVC.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

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