Repository navigation
arm64: dts: apple: give every DART its engine's power domain, and lint it - #2261
Conversation
A DART probes as a device of its own. When its node names no power domain, nothing holds the block it sits in on while it probes or runs, and its first register read takes an SError when iBoot left that block off. The DART has no power gate of its own; its engine's state covers it. Several DARTs were added without one, and nothing caught it. apple-dart-pd-check.py reads the compiled Apple DTBs and lists every node with an "apple,*dart*" compatible that has no power-domains, and every enabled DART that names a disabled power state (it would wait for it forever) unless its engine names the same state. The SEP's and the AOP's DARTs are exempt: those coprocessors run from before the handoff on states the AP never switches off. Overrides through &label are covered, as the check reads the DTBs, not the sources. With --baseline-dtb-dir only new findings fail, as the ADT coverage ratchet does, so the remaining ones can be fixed per SoC while no new DART lands without its domain. The device tree workflow runs it base against head. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…DARTs their power domains The USB4 NHI DARTs (usb4_N_dart) and the PCIe-C tunnel DARTs (apciecN_dart) on M1, M2, M1 Pro/Max/Ultra and M2 Pro/Max/Ultra name no power domain, while their engines do: the ACIO block holds ATCn_CIO and the PCIe-C root port holds ATCn_PCIE. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give each DART its engine's state, as the T6050 ACIO and PCIe-C DARTs already have: - usb4_N_dart: ps_atcN_cio (the NHI DART sits in the ACIO block), - apciecN_dart: ps_atcN_pcie, the root port's own domain, - T6002 apciec4/5 (die 1 ports 0/1): ps_atc0/1_pcie_die1, - T6002 AUSB DARTs: ps_c0/1_usb31drd, their controller's domain, - the second DISPEXT DART of each M2-generation external display block (m2_dart_dispextN_1): the DISPEXT CPU state its sibling DART already names, - the T8103 PMP DART: ps_pmp, as on every other SoC. ATCn_PCIE is apple,always-on on the non-Ultra M1/M2 SoCs, so the PCIe-C DARTs there now take the retained-domain path of the DART driver (no register save on suspend, no reset on resume), which was written for this state and could not be reached while the DARTs named no domain. Fixes: 2f2c0fb ("arm64: dts: apple: t8103: Add USB4 ACIO and NHI") Fixes: 80ee643 ("arm64: dts: apple: t60xx: Add USB4 ACIO and NHI") Fixes: 13d0483 ("arm64: dts: apple: add T8103 and T8112 PCIe-C tunnels") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…power domains On M3, M3 Pro/Max/Ultra and M4 the USB4 NHI and PCIe-C DARTs, the internal display DARTs, the AVE, APR (ProRes/scodec) and RSM DARTs, the display/ISP/AVE companion DARTs and the T8132 SIO and APCIE port 2 DARTs name no power domain. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give each DART the state of the engine it serves, taken from the engine's own node or from the same DART on the sibling SoC: - usb4_N_dart: ps_atcN_cio; usb4_N_pcie_dart: ps_atcN_cio_pcie, as the PCIe-C port names, - dcp_dart, disp0_dart and the DISP0 companion: the state the DCP names (ps_disp_cpu; ps_disp_fe on T6031/T6034), - DISPEXT companions: the state their block's DARTs name, - AVE DARTs and companions: the encoder's system state (ps_venc_sys, ps_venc0/1_sys), as the T6031 AVE DARTs have, - APR DARTs: the state the APR engine names (scodec or ProRes), - ISP companions: ps_isp_sys, as the ISP DARTs have, - RSM DARTs: ps_debug_gated, as on T6050 and T6031's RSM engine, - T8132 SIO DART: ps_sio_cpu, the SIO's own state, - T8132 APCIE port 2 DART: ps_apcie_sys_gp. Every node except the USB4 DARTs, the T6030 and T8132 PCIe-C DARTs and the T8132 DCP DART (J604, J713, J715) is disabled. The enabled ones name states that are enabled on every board that enables them, but one: on J604 the DCP DART now waits for ps_disp_cpu, which that board leaves disabled; the DCP there names the same state, so it cannot probe either way. The T8132 internal PCIe DART (dart_apcie0) is left alone: J713 and J715 enable it and leave ps_apcie_sys_gp disabled. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… power domains On T6040 (M4 Pro) the internal PCIe DARTs (pcie_dart, apcie1_dart and the J773s apcie2_dart), the USB4 NHI and PCIe-C DARTs and the internal and external display DARTs name no power domain; only the J616s board files give the external display DARTs one. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give each DART the state of the engine it serves: - internal PCIe DARTs: ps_apcie_sys_gp, which the J616s PCIe controller names, - usb4_N_dart: ps_atcN_cio; apciecN_dart: ps_atcN_pcie, as the PCIe-C ports name, - disp0/dcp DARTs: ps_disp_fe; dispextN/dcpextN DARTs: ps_dispextN_fe, the front-end states the J616s external display DARTs already name (the CPU states belong to the coprocessor firmware). These states exist only in the T6040 PMGR, so the PCIe and display DARTs, which t604x.dtsi shares with T6041, get them in t6040.dtsi. The internal PCIe DARTs are enabled on every T6040 board, but only J616s enabled APCIE_GP and APCIE_SYS_GP, so on J614s and J773s the DARTs would wait for them forever. Enable both, always-on, in t6040.dtsi, for the reason J616s gives: iBoot leaves them on, and the PCIe driver keeps internal links up through suspend-to-idle and cannot retrain them after a power cycle. J616s's own description stays as it is. The display and PCIe-C DARTs are disabled on every T6040 board, and the USB4 DARTs are enabled only where ps_atcN_cio is. Fixes: 05319b8 ("arm64: dts: apple: share the T604x SoC and PMGR description") Fixes: c5fd88e ("arm64: dts: apple: t604x: describe the T6040-only blocks in t6040.dtsi") Fixes: 3aefcf6 ("arm64: dts: apple: describe remaining fleet control devices") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…domains On T8140 the internal display DARTs (disp0_dart, dispgrt_dart, dcp_dart), the external display DARTs (dispext0_dart, dcpext0_dart) and the RSM DART name no power domain, while the same DARTs on T8103, T8112 and T600x do. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give each DART the state of the engine it serves: - DISP DARTs: ps_disp_cpu, which the DCP names (always-on here, as its firmware owns it), - DISPEXT0 DARTs: ps_dispext0_cpu, which dcpext names, - RSM DART: ps_debug_gated, as the T6050 RSM DART has. All six DARTs are disabled on J700, so no current boot changes; when one is enabled it now waits for its block's state instead of probing on an unpowered block. ps_dispext0_* stay disabled until the external display coprocessor has a driver, as before. Fixes: f7079d0 ("arm64: add an isolated T8140 graphics and power profile") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…their power domains The shared T6050 PCIe-C DARTs (apciec0-3_dart) and the internal display DARTs (disp0_dart, dcp_dart) name no power domain, while the board-level PCIe-C DARTs on J714s/J716c already name ps_atcN_pcie. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give the PCIe-C DARTs ps_atcN_pcie, as the board-level ones have, and the display DARTs ps_disp_cpu, the DISP CPU state, as on T8132 and T8140. All of these nodes are disabled on every T6050 board, so no current boot changes. The external display DARTs, the USB4 port 3 DART and the internal PCIe DARTs are left: the T6050 PMGR describes no DISPEXT system/CPU states, and the boards that enable usb4_3_dart and the APCIE DARTs leave ps_atc3_cio and ps_apcie_sys_gp disabled. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…main The T8142 internal PCIe DARTs (pcie0_dart, pcie2_dart) name no power domain, while the T8112, T8122 and T8140 PCIe DARTs do. A DART probes as a device of its own, so nothing holds its block on while it probes or runs on its own, and its first register read faults if that block is off. Give both ps_apcie_sys_gp, the APCIE system state. It is enabled on every T8142 board and is a parent of ps_apcie_phy_sw, which the NVMe controller holds, so the DARTs add a holder and power nothing down. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd USB4 DARTs dd93e00 gave the T6040 display DARTs ps_disp_fe/ps_dispextN_fe and the USB4 and PCIe-C DARTs ps_atcN_cio/ps_atcN_pcie in the SoC files. Those states are disabled in the SoC description and enabled per board, and the display ones on no board at all. The boot loader enables disp0_dart, dcp_dart and the internal DCP when it hands the panel over, but not DISP_FE, so on J616s both DARTs waited for a domain that never registered, timed out with -110, and the DCP stayed deferred ("PIODMA iommu domain is unavailable"). A DART must follow its engine. The internal DCP names no power domain on T6040: iBoot hands the display over running and its DISP states are left to the firmware, as on T8140 before its DISP states were described. So the display DARTs name none either; they get DISP_FE together with the DCP once the DISP states are described and enabled. The J614s and J616s external display DARTs keep the states their board files already gave them. The USB4 NHI DARTs now name ps_atcN_cio in the J614s and J616s board files, next to where those boards enable the ATC states and the DARTs. The PCIe-C DARTs are enabled on no T6040 board, so they get their state where a board enables PCIe tunnels. Fixes: dd93e00 ("arm64: dts: apple: t6040: give the PCIe, USB4 and display DARTs their power domains") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y DARTs their power domains" This reverts commit 817869f. The states it named (ps_atcN_pcie, ps_disp_cpu) are disabled on every T6050 board. A DART that names a disabled state never probes, and the boot loader enables DARTs the device tree leaves disabled: on T6040 it enabled the display DARTs and they then waited forever for their domain. The T6050 internal DCP names no power domain either, so its DARTs follow it and name none. The PCIe-C DARTs get ps_atcN_pcie where a board enables PCIe-C, as the J714s and J716c board files already do. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es them 202ede0 gave the T8132 display, ISP companion, AVE, APR and SIO DARTs their engines' states in the shared SoC files. Some boards leave those states disabled: J604, J623, J624 and J773g do not enable DISP or DISPEXT, J773g has no ISP, and the J713 PMGR policy disables VENC, SCODEC and SIO_CPU. A DART that names a disabled state never probes, and the boot loader enables DARTs that the device tree leaves disabled (it did so with the T6040 display DARTs, which then waited forever). So the display DARTs and the DISP/DISPEXT companions name their states in t8132-j713-pmgr.dtsi, where J713 and J715 enable them, and the ISP companions in t8132-isp.dtsi, which enables ps_isp_sys. The AVE, APR and SIO DARTs keep their states in t8132-peripherals.dtsi, and J713 drops them with the states it disables. Fixes: 202ede0 ("arm64: dts: apple: t8122/t8132/t603x: give the remaining DARTs their power domains") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…domain f7538e6 gave dispext0_dart and dcpext0_dart ps_dispext0_cpu. The DISPEXT0 states are disabled on purpose until the external display coprocessor has a driver (6b57d54): its firmware owns them, and powering one down under it faults. A DART that names a disabled state never probes, and the boot loader enables DARTs the device tree leaves disabled. So these two DARTs get their state together with the DISPEXT0 states, when that driver lands. The internal display DARTs keep ps_disp_cpu, which is enabled and always-on on J700. Fixes: f7538e6 ("arm64: dts: apple: t8140: give the display and RSM DARTs their power domains") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
apple-dart-pd-check.py only checked the power states of DARTs that the device tree enables, and let an enabled DART name a disabled state when its engine named the same one. The boot loader enables DARTs that the device tree leaves disabled: on T6040 it enables the internal display DARTs when it hands the panel over, and with a disabled DISP_FE named they waited for it until the deferred probe timeout, so the DCP never probed. Nothing in the device tree says which DARTs a loader enables. So any DART, whatever its status, that names a power state disabled in the same DTB is now a finding. The state is reported by its path, so a baseline built without labels keys the same. Fixes: 6539f98 ("scripts/dtc: check that every Apple DART names a power domain") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…R file 1bcf59f put the J713/J715 display DART domains and the dropped AVE/APR/SIO DART domains into t8132-j713-pmgr.dtsi. That file is also included by drivers/soc/apple/t8132-platform-data.dts, which carries the PMGR states only and has no DART nodes, so its build failed: "Label or path disp0_dart not found". Move the overrides to t8132-j713-j715.dtsi, which only the J713 and J715 board files include. The J713 and J715 DTBs are unchanged. Fixes: 1bcf59f ("arm64: dts: apple: t8132: name DART states only where the board enables them") Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The DART power-domain series gives every Apple DART node its engine's power domain, the apple,*-dart-smmu companion nodes included, but this binding did not list power-domains. CHECK_DTBS then flagged each of those nodes (105 warnings across the T8122, T8132 and T603x DTBs). Allow one power domain, as apple,dart.yaml does. Signed-off-by: Ryan Murray <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at c2ff890.
- The rule finding is fixed. The dt-checks failure at e8b68e8 (105 new
power-domainswarnings onapple,*-dart-smmu) is gone after the binding commit: dt-checks at this head reports 0 new warnings, and the new DART lint step ran with 891 without a domain, 0 new and 518 fixed. - Spot-checked the M1/M2 USB4/PCIe-C, T8103 PMP, T6040 internal PCIe and T8140 display DART domains against their engines. t6040.dtsi now enables APCIE_GP/APCIE_SYS_GP always-on for J614s and J773s too, as described.
drivers/soc/apple/t8132-platform-data.dtspreprocesses and compiles with dtc at this head (the f156db2 label failure is fixed).
To refresh before merge: drift since the tested base touches t8132-isp.dtsi, so I'm updating the branch and waiting for dt-checks. The T8103/T8112/T600x Stage 2 DTB row, especially s2idle with ps_atcN_pcie always-on now reaching the PCIe-C DART, is owed post-merge.
|
Post-merge row for cfc8ce0 on our M2 (J413, T8112), with the merged DT at boot. M1 Pro (J316s, T6000) row follows. Setup. One-shot Stage 2 = our live production Stage 2 with only the
The merged DT boots and sleeps cleanly on T8112. The four enabled DARTs that gain a domain sit under the |
|
Post-merge row for cfc8ce0 on our M1 Pro (J316s, T6000), with the merged DT at boot. Setup. One-shot Stage 2 = our live production Stage 2 with only the
The merged DT boots and sleeps cleanly on T6000. As on the M2, the DARTs that gain a domain sit under Baseline noteThe first production baseline cycle returned rc=1 after 1 s ("Some devices failed to suspend, or early wake event detected"). A re-run on production right after gave 3/3 rc=0. The merged-DT boot did not show it. |
Problem
A DART probes as a device of its own. Where its node has no
power-domains, nothing holds its block on while it probes or runs, and its first register read takes an SError if iBoot left the block off. The DART has no power gate of its own; the engine's covers it. The same DARTs on T8103/T8112/T600x already named one, so this was a per-SoC gap in the device trees, not a hardware difference.Change
Apple DART nodes now name the power state of the engine they serve, wherever that state is enabled in the board's device tree, and a DTB lint in
dt-checkskeeps it that way. Theapple,*-dart-smmubinding now allows onepower-domainsentry (asapple,dart.yamldoes), since the companion DART nodes get their engine's domain too.Testing
make dtbs(release config, LLVM=1) builds all 137 Apple DTBs with no dtc warnings at the default level.scripts/dtc/apple-dt-check.sh(CHECK_DTBS + dt_binding_check, as in CI) on integration/aurora 2c35f50 against this branch merged into it: 1404 warning lines on both sides, 0 new, 0 removed;dt_binding_checkofapple,dart-smmu.yamlclean. Before the binding commit the same check reported 105 newpower-domainswarnings on theapple,*-dart-smmunodes.apple-dart-pd-check.py), base vs head: 891 DARTs without a usable domain, 0 new, 518 fixed. DARTs naming a disabled state: 0 new.tools/asahi/run-host-tests.py): 427/427 pass.devices_deferredempty, 0 DART probe failures, 34 DARTs bound (same as the current DT), internal panel connected, 3 s2idle cycles rc=0, 0 AVC.Still to run
What the DT and lint changes cover
scripts/dtc/apple-dart-pd-check.pyreads the compiled Apple DTBs. It flags two cases. First, anyapple,*dart*node withoutpower-domains. Second, any DART, whatever its own status, that names a power state disabled in the same DTB. Such a DART never probes, and the boot loader enables DARTs that the device tree leaves disabled. Because the check reads DTBs,&labeloverrides are covered. The SEP's and the AOP's DARTs are exempt. With--baseline-dtb-dironly new findings fail.dt-checks.ymlruns it base against head, next to the ADT coverage ratchet.power-domains, or from the same DART on a sibling SoC. A DART names a state only where that state is enabled; where the engine names none, the DART names none either.ps_atcN_cio: T8103, T8112, T600x, T602x, T603x, T8122 and T8132. On T6040 they get it in the J614s/J616s board files, which enable the ATC states.ps_atcN_pcieorps_atcN_cio_pcie: T8103, T8112, T600x, T602x, T6030 and T8132.ps_apcie_sys_gp: T6040pcie_dart,apcie1_dartand J773sapcie2_dart; T8132 port 2; T8142pcie0_dartandpcie2_dart.ps_disp_cpuon T6030, T8122 and T8140, and on T8132 J713/J715 (set int8132-j713-pmgr.dtsi), andps_disp_feon T6031/T6034.t6040.dtsinow enables both, always-on, for the reason J616s gives: iBoot leaves them on, and the PCIe driver keeps internal links up through suspend-to-idle and cannot retrain them after a power cycle. Across all 137 Apple DTBs, that is the only change besidespower-domains. J713 also deletes the AVE/APR/SIO DART domains next to the states its PMGR policy disables.Old state
There was no gate: the property was missing on the nodes. Main origins:
pcie_dart(05319b8) and t6040.dtsiapcie1_dart(c5fd88e);Why this is safe on every SoC
Adding a DART as a consumer of an enabled state can only keep that state on longer: genpd powers a state off when all its consumers are suspended, and the DART follows its consumers through its device links. No DART in this PR names a disabled state in any of the 137 DTBs, whatever the DART's own status. The lint finds 367 DARTs that name a disabled state at both base and head, the same set. These come from older commits (ISP, ANE, scaler and media DARTs, and the J614s/J616s and T8132 external display DARTs) and are listed in the evidence set.
Behaviour change to note:
ps_atcN_pcieisapple,always-onon the non-Ultra M1/M2 SoCs (T8103, T8112, T6000/T6001, T6020/T6021). The DART driver reads that flag through the PCIe-C DART'spower-domains. It then keeps the DART's state over suspend: no save, and no reset on resume. That path could not be reached while these DARTs named no domain.Not given a domain, and why:
mtp_darteverywhere: no MTP state is described.usb4_3_dartand APCIE DARTs: the states are not described, or disabled on the boards that enable the DARTs.dart_apcie0: J713/J715 leaveps_apcie_sys_gpdisabled.Why this is safe on every SoC, and which DARTs get no domain
Adding a DART as a consumer of an enabled state can only keep that state on longer: genpd powers a state off when all its consumers are suspended, and the DART follows its consumers through its device links. No DART in this PR names a disabled state in any of the 137 DTBs, whatever the DART's own status. The lint finds 367 DARTs that name a disabled state at both base and head, the same set. These come from older commits (ISP, ANE, scaler and media DARTs, and the J614s/J616s and T8132 external display DARTs) and are listed in the evidence set.
Behaviour change to note:
ps_atcN_pcieisapple,always-onon the non-Ultra M1/M2 SoCs (T8103, T8112, T6000/T6001, T6020/T6021). The DART driver reads that flag through the PCIe-C DART'spower-domains. It then keeps the DART's state over suspend: no save, and no reset on resume. That path could not be reached while these DARTs named no domain.Not given a domain, and why:
mtp_darteverywhere: no MTP state is described.usb4_3_dartand APCIE DARTs: the states are not described, or disabled on the boards that enable the DARTs.dart_apcie0: J713/J715 leaveps_apcie_sys_gpdisabled.Bugs the hardware trials found (both fixed)
disp0_dart/dcp_dart(402300000/402340000) namedps_disp_fe, which is disabled in the DTB. The loader enables those DARTs and the DCP but not DISP_FE, so both DARTs failed after the deferred probe timeout (-110) andapple-dcp 402e00000stayed deferred. Fixed in e16376a (display DARTs follow the DCP and name no domain) and f156db2 (the lint flags a disabled state whatever the DART's status).drivers/soc/apple/t8132-platform-data.dtb.o, which includest8132-j713-pmgr.dtsi, failed at f156db2 with "Label or path disp0_dart not found": the J713 DART overrides sat in that PMGR file. e8b68e8 moves them tot8132-j713-j715.dtsi; all 137 Apple DTBs are byte-identical to those at f156db2.Thanks to Sven Peter, DjDeveloperr and Artyom Astafurov, whose USB4, PCIe-C and T604x descriptions these nodes come from.
Assisted-by: LLM (Claude:Opus 5.5)