Repository navigation
iommu: apple-dart: keep a 27.2 J773g dcpext's locked display DARTs like the J713's - #2596
RyanTheTide wants to merge 4 commits into
Conversation
…ke the J713's On the macOS 27.2 stub the M4 Mac mini's (J773g) dcpext0 runs the 26B123 image on the firmware-27 backend (apple_t8132_dcpext_v27_2()). Its firmware and display DARTs are not borrowed there (the T8132 firmware path is the Air's or 26.6.2's), so they take the plain locked path. The boot loader re-exports the processor's firmware segments into slots its firmware already holds, and on that path apple_dart_publish_root() refuses any Linux table in such a slot: the attach would fail and leave the processor without a domain. Give a locked DART that an available 27.2 T8132 dcpext names in its iommus, or in its PIODMA's, the locked-root handling the J713's internal display DARTs get on 27.2 (fw_mirror), and map its re-exported segments with their live leaves' protection (the flag is now fw_live_prot). An unlocked DART is left as it was. The Air's borrowed external DARTs are never selected. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Hardware note from the J773g (M4 Mac mini, macOS 27.2 stub), 11-20. This is not a row for this PR's own code. The kernel that ran on the mini was
What the hardware showed with afcbcf4:
So the dcpext0 path is proven with the locked-roots mirror approach. This PR still needs its own row: a boot of an Image with it (4e080f9) ( |
|
Blockers: 1.
The selection walk itself is correct: for_each_compatible_node/for_each_child_of_node drop their references when they run to completion, and an unlocked DART stays on the plain path. HW row: J773g on 27.2 with this head (not the interim afcbcf4): Assisted-by: LLM (Claude:Opus 5.5) |
…p272-j773g-dcpext #2590 gained the review follow-ups (firmware-table and window checks in the live-leaf protection, the refusal as dev_err) and a merge of its base. Keep this branch's fw_live_prot name for the flag and the function, with #2590's checks inside it and its dev_err split beside the T8132 external display line; the KUnit case keeps the new name and gains #2590's reserved tables, window and mixed/outside cases. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…p272-j773g-dcpext #2590 now keys a 27.2 internal display DART on its processor's handoff with apple_dart_serves_t8132_dcp_v27(), the internal twin of this branch's apple_dart_serves_t8132_dcpext_v27(). Resolve them into one helper, apple_dart_serves_v27_dcp(dart, compatible, predicate), used with apple,t8132-dcp / apple_t8132_dcp_v27_2() for the internal processor and apple,t8132-dcpext / apple_t8132_dcpext_v27_2() for the external ones. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Blockers: 1.
Smaller: an unlocked DART serving a 27.2 dcpext stays on the plain path (:6057-6063) while the internal case is refused; please refuse it too or explain why programming it under a running processor is safe. The selection walk itself is reference-correct. Rows: still needs a J773g 27.2 boot of this code (not the interim patch) showing "locked roots kept (mirror)" on 286340000 and 286300000, the live-leaf protection lines, HDMI lit and 0 DART faults, plus a J713 boot of the same kernel with the internal panel lit. |
|
Merged #2590's new head forward (906db1f, one merge commit, no force push). #2590 now keys its 27.2 internal display DARTs on the DCP's handoff (2a3bb37), the same way this PR keys the J773g dcpext DARTs. The two lookups are now one helper, Assisted-by: LLM (Claude:Opus 5.5) |
…xt/air-dcpext-272 #2596 now carries #2590's 2a3bb37, which keys a 27.2 internal display DART on its processor's handoff and folds the internal and external DART checks into one helper, apple_dart_serves_v27_dcp(dart, compatible, predicate). Resolve: - include/linux/soc/apple/t8132.h: apple_t8132_internal_dcp_v27_2() is gone at the base; keep this branch's comment on apple_t8132_dcpext_v27_2() and apple_t8132_dcpext_hdmi_v27_2(). - boot.py: keep this branch's comments, which name both boards. - apple-dart.c: this branch's apple_dart_serves_t8132_dcpext_v27() call becomes apple_dart_serves_v27_dcp(np, "apple,t8132-dcpext", apple_t8132_dcpext_v27_2), the same body. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…p272-j773g-dcpext Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…xt/air-dcpext-272 #2541 (now 1c70a92) derives the J773g's fixed-DP chain from its phandles (gate_t8132_run(), machine apple,t8132) and drops the J773g node list. Keep the Air's 27.2 Type-C dcpext gate as it is: the Airs return from apple_display_gate_soc() after the 26.6.2 routes before gate_socs[] is walked, and gate_t8132_dcpext_v27() appends their display DARTs after whatever the SoC gate left. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> # Conflicts: # drivers/soc/apple/display-gate.c
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at live head 0d7365a982bb1cf073f3d0c1afc037759a2aff6e (§4 human commit attribution/SoB and §6 naming clean).
Blockers
-
§1 violation — firmware-version & single-build UUID gating (
drivers/iommu/apple-dart.c:5477-5492,:5547-5550,:6054-6067)t8132_dcpext_v27enablesfw_mirrorandfw_live_protforapple,t8132-dartonly whenapple_t8132_dcpext_v27_2()->apple_dcp_image_v27_2()(include/linux/soc/apple/display.h:30-49) matchesapple,firmware-version == <27 2 0>,apple,firmware-compat == <27 2 0>, and the single26B123UUID (APPLE_T8132_DCP_26B123_UUID). Any newer macOS 27.x build UUID/version silently disablesfw_mirrorand breaks display attach again.- Right beside it (
apple-dart.c:6054-6059),t6041/t6050/t8140/t8142already enablefw_mirrorpurely from the DART's own hardware state (dart->locked && !dart->fw_handoff).__apple_dart_fw_live_prot()is also self-limiting (it only adjusts anIOMMU_RESV_TRANSLATEDregion whose every page matches the live leaf mapping with one uniform protection). - Fix: Enable
fw_mirror(andfw_live_prot) for lockedapple,t8132-dartinstances without a reserved-table handoff (excluding only borrowed external/internal DARTs, which are already excluded), and drop the27.2.0/26B123-UUID gate. If a specific locked T8132 DART must not mirror, document which one in the commit message and exclude it by a property of that DART.
-
Unlocked DART handling asymmetry (
drivers/iommu/apple-dart.c:6060-6071)- An unlocked internal display DART (
j713_display_v27 && !dart->fw_mirror) is refused with-EINVAL(:6068-6071), whilet8132_dcpext_v27 && !dart->fw_mirroronly logs"not locked"(:6064-6066) and proceeds into normal DART initialization/reset underneath a live 27.2dcpext. Either refuse symmetrically or justify in code/commit why resetting an unlocked DART serving a livedcpextis safe (iffw_mirroris keyed ondart->locked, this special case disappears cleanly).
- An unlocked internal display DART (
-
Missing CI and §5 hardware proof on live head
0d7365a9- The PR is stacked on unmerged
#2590(j713-disp2/dcp272-internal) and has 0 CI checks run (statusCheckRollupis empty). - No hardware boot has run
#2596's own code yet (the 11-20 J773g boot ran interim patchafcbcf43, not#2596). Needs a J773g 27.2 boot of this head showinglocked roots kept (mirror)on286340000and286300000, live-leaf protection lines, HDMI lit, 0 DART faults, plus a J713 regression boot on the same kernel, with 0 SELinux AVC denials, 0 failed units, and 0 new kernel errors on both.
- The PR is stacked on unmerged
Non-blocking note
- In
__apple_dart_fw_live_prot()(drivers/iommu/apple-dart.c:4594-4599),pm_runtime_put(dart->dev)is called at:4595beforeapple_dart_readl(dart, DART_TCR(dart, sid))at:4598. Movepm_runtime_put()after theDART_TCRread so it cannot perform MMIO after dropping the runtime PM reference iffw_live_protis broadened to 4-level DARTs.
Assisted-by: LLM (Gemini 4 Neon)
|
Closing: this keys the DART handling on one firmware build; a replacement should keep the roots of any locked T8132 display DART, as the newer SoCs already do. |
|
Reopened and kept as a draft; the comment above lists what it still needs before review. cc @niteria |
|
Replaced by #2825 (draft, stacked on #2818). This branch sits on the closed #2590 and brings in #2541's old commits, some with agent trailers, through its merges, and it conflicts with #2818. So the fixes went onto a clean branch rather than here. How the review points were handled:
Testing on #2825KUnit arm64 16K: apple-dart 38/38 with a new selection case. With appledrm built in, 284 tests, 282 pass and 2 skip (OF_OVERLAY). apple-dcp host selftests 92/92. apple-dart.o W=1 clean; checkpatch --strict clean. Assisted-by: LLM (Claude:Opus 5.5) |
Problem
On the macOS 27.2 stub, the M4 Mac mini's (J773g) dcpext0 runs the firmware-27 backend from #2541. On a 27.2 mini its display DARTs aren't borrowed, so they take the plain locked path. If iBoot leaves them locked with the firmware's live slots, the boot loader's re-exported firmware segments land in those slots.
apple_dart_publish_root()refuses any Linux table there, so the attach fails and the processor has no IOMMU domain. #2578 then refuses the processor.This is the failure the M4 MacBook Air (J713) hit on its internal DCP. #2590 fixed it there with two changes; this ports both to the J773g dcpext, as Dj asked.
Change
Stacked on #2590.
apple_t8132_dcpext_v27_2(), not by address), gets the locked-root handling (fw_mirror).fw_live_prot, since it now covers both cases.Testing
apple-dart.oplus the t8132-j713 and t8132-j773g DTBs, no new warnings.Still to run
T8132 external display DART on the 27.2 image: locked roots kept (mirror)(ornot locked) for 286340000 and 286300000. If it reports "not locked", this change does nothing.Reviewer / agent detail
apple_dart_publish_root()returns -EBUSY for a slot whose live entry is non-zero unlessapple_dart_fw_slot_owned()finds it in a firmware snapshot. The snapshot (apple_dart_snapshot_fw_root()) exists only withfw_mirrororfw_handoff, andfw_mirrorwas compatible-gated to t6041/t6050/t8140/t8142.apple_dart_fw_slot_mirrors()). The core maps iommu-addresses regions read-write, and uncached for adma-noncoherentDCP (the T8132 dcpext nodes are). On the J713 the firmware's text leaves are read-only and every segment is cacheable, so every segment was refused until the regions take the leaves' protection.apple_dart_serves_t8132_dcpext_v27()walks theapple,t8132-dcpextnodes that are available and passapple_t8132_dcpext_v27_2(), and matches the DART in the node's iommus or its children's (PIODMA). On the J773g DT that isdcpext0_dart(SID23) anddispext0_dart(SID16; the display gate also points the display subsystem's SID0 there).Assisted-by: LLM (Claude:Opus 5.5)