Repository navigation
drm/apple, phy: apple: light a USB-C display from a firmware-27 DCP on a T8103-generation ATC PHY - #2868
Conversation
The DP PHYs without drive level control (the T8103 generation, which the M1 and M2 ATC PHYs are) refused a voltage swing and pre-emphasis request with -EINVAL, like an invalid configuration. A caller then cannot tell "this PHY keeps its levels" from a request that is wrong. Return -EOPNOTSUPP for it. The lanes keep the levels their tunables set up, as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On firmware 27, SetDriveSettings passes DCP's requested voltage swing and pre-emphasis to the Type-C PHY. A PHY without drive level control refuses that, the call fails and DCP restarts link training: on the M2 Mac mini, a USB-C display behind a DP-to-HDMI adapter trained at HBR2 x4 five times and stayed disconnected. Before firmware 27 the levels were only recorded, which is how these PHYs have always trained. When the PHY says it has no drive level control, keep the levels DCP asked for and answer as before; any other PHY error still fails the call. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…routes
dcp_v27_dptx_layout() chooses the DPTX controller and port endpoints
from what firmware 27 advertises, but only for a dcpext. A primary DCP
that the device tree connects to Type-C display routes, as on the M2 Mac
mini, keeps the default endpoints, so its DPTX endpoint start times out
("Failed to start DPTX endpoint: -110") and USB-C displays stay dark.
Choose the advertised endpoints for a DCP with Type-C routes too.
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at 1c33c3b. The endpoint and PHY parts look right. Selection goes through the DT (
|
…outes "drm/apple: dcp: open the firmware-27 DPTX ports of a DCP with Type-C routes" lets a DCP that the device tree connects to Type-C routes take the advertised DPTX endpoints, not only a dcpext. The layout test still modelled the dcpext-only rule and failed. Run the matrix with and without Type-C routes, adapt the mutations to the new condition, and add one that leaves a DCP with Type-C routes on the default endpoints. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at 5029465: no blockers. Adversarial pass at this head (4 commits on 110861f). Code read plus host tests: Before merge:
Nits (none block):
Other Macs: the Full reviewVERDICT: NO BLOCKERS Reviewed at head 5029465 (4 commits on merge-base 110861f, base tip e0a9448). What was checked and how
1. Correctness-EOPNOTSUPP does not leak to a caller that treated -EINVAL specially.
Other sources of -EOPNOTSUPP that the handler now swallows (dptx-drive-v27.inc:111). Checked every
Layout selection (
Error paths. With Ordering. Reply to DCP / locking. On -EOPNOTSUPP the handler records and echoes the requested levels (dptx-drive-v27.inc:114-131), the same answer the pre-27 handler gives. The new return in atc.c is before any register access and takes no lock; 2. Binding rules
3. ProvenanceNo new firmware class/method names, register names or addresses in code or comments. "SetDriveSettings" in the commit messages is already in the tree (dptx-drive-v27.inc:17). Endpoint numbers 0x24/0x2a in the test docstring were already there. 4. Commit hygieneAll four commits: author and Merge conditions (not code blockers)A. Inert at the base tip without #2853. At this head a T8112 DCP with a 27.x Nits
Missing rows
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at live head 5029465c333af4cac084c6aa5c33835b7a810793 (CI green: host-tests).
Technical Audit (PHY/DCP Handoff & Non-Regression)
dcp.c(dcp_v27_dptx_layout): Clean DT + RTKit advertisement selection (!dcp->dcpext && !dcp->nr_typec_routes, plus advertisedDPTX_CONTROLLER_ENDPOINTandDPTX_ENDPOINT). No model/compatible gating. Cross-checking all Apple DTS files confirms that onlyt8112-j473.dtsattachestypec-routesto a primary&dcpnode; every other board putstypec-routesonapple,dcpext, so older firmware and other SoCs are unaffected.atc.c&dptx-drive-v27.inc: OnATCPHY_GENERATION_T8103(T8103/T8112/T600x/T602x),atcphy_dpphy_configure()returns-EOPNOTSUPPinstead of-EINVALforopts->set_voltages, anddptxport_call_drive_v27()treats-EOPNOTSUPPas "keep PHY tunable levels". T8122/T8142/T604x/T6050 (dp_t8122), T8140 (has_t8140_dp), and pre-27 firmware paths are untouched.
Checklist Summary
- §1 No model gating: Pass (driven by PHY generation ops, DT
typec-routes, and RTKit advertised endpoints). - §2 Production-ready (hard): Fail (see blocker 1).
- §3 Safety: Pass (tunable drive levels unchanged; no hardcoded limits).
- §4 Clean-room & attribution: Pass. All 4 commits (
9cbc00e0,2b316ee5,1c33c3b8,5029465c) carry human author/committer (Ryan Murray) andSigned-off-by, zero AI trailers in commits. - §5 Evidence: Fail (see blockers 1 & 2).
- §6 Naming: Pass (modifies existing
tools/asahi/host-test harness in place; no new Asahi/m1n1 naming introduced).
Blockers
- §2 (hard) / §5 Default command line & regression row missing: The PR is marked ready for review (
isDraft: false), yet the only hardware row recorded in the PR body ran with development-onlydyndbgenabled fordptxep.cand the ATC PHY (explicitly listed under## Still to run) and omits0 failed units/0 AVC denials. Per §2 (Development boots may use extra parameters. Remove them and re-prove on the default command line before the PR), re-prove USB-C DP link training/modeset + simultaneous HDMI on the default kernel command line (nodyndbg, which perturbs link-training timing) with a full §5 regression check (0 SELinux denials, 0 failed units, 0 new kernel errors). - §5 / Merge-train dependency (
#2853OPEN andDIRTY): At live head5029465conintegration/aurora,dcp_check_firmware_version()(dcp.c:6108-6129) still rejects 27.xapple,firmware-compatforapple,t8112-dcp(DCP_FIRMWARE_UNKNOWN), making this series inert on tip withoutaurora-silicon/linux#2853(currently OPEN withmergeStateStatus: DIRTY). The recorded J473 row also ran on#2853+ the first 3 commits + an unmergedaura#467Stage 2 rather than an integrated tip build at live head5029465c. Land or rebase onto#2853and record a clean default-cmdline hardware row at the verified live head.
Non-blocking nits
-EOPNOTSUPPoverloading (dptx-drive-v27.inc:111): Treating any-EOPNOTSUPPfromphy_configure()as "PHY keeps its tunable levels" conflates it withphy-core.c(missing.configure) andatc.c:4924(T8132 returning-EOPNOTSUPPwhen!atcphy_t8132_dp_on()). Safe today because T8132 uses the M4 firmware path, notdptx-drive-v27.inc, but returning0(withdev_dbg) for a drive-only request on T8103-generation PHYs—matching the existing T8132 branch atatc.c:4925-4929—would avoid overloading-EOPNOTSUPPand keepdptx-drive-v27.incfree of errno special cases.- Condition drift in
dptxep.c:1676&dcp-internal.h:318:dptxep_init()still gates the soft"DPTX port %u not announced yet"return on(dcp->fw_compat == DCP_FIRMWARE_V_27_0 && dcp->dcpext)without|| dcp->nr_typec_routes, and the comment atdcp-internal.h:318still saysdcpextonly. - Host-test bisect gap: Commit
1c33c3b8addsdcp->nr_typec_routestodcp_v27_dptx_layout(), breakingtools/asahi/dcp-v27-dptx-layout-tests.pycompilation until5029465c. If respun, consider folding the harness update into1c33c3b8. - Host test coverage: Adding a small host-test case covering the
-EOPNOTSUPPvs-EINVALhandling indptx-drive-v27.incwould pin the new branch.
Assisted-by: LLM (Gemini 4 Neon)
… control The T8103-generation ATC PHYs (T8103, T8112, T600x, T602x) have no drive level control: the lanes keep the levels their tunables set up. Answering a drive request with -EOPNOTSUPP and special-casing that errno in the firmware-27 SetDriveSettings handler overloads an errno that the phy core (no .configure) and the T8132 branch (DP alt mode not up) also return. Do what the T8132 branch already does: a drive-only request succeeds with a debug line and leaves the lanes alone, and drive levels together with a rate or lane change stay -EINVAL. The firmware-27 handler passes every PHY error back to DCP again, so a real failure still fails the call. tools/asahi/atc-dp-drive-tests.py builds the production atcphy_dpphy_configure() against stubs and checks the request matrix for the T8103 generation, T8132's DP-off and DP-on answers and the T8122 handler, and that the drive handler has no errno special case; three mutations (the -EOPNOTSUPP answer, accepting drive levels with a rate, refusing every drive request) must fail it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…in dptxep_init() dcp_v27_dptx_layout() moves the DPTX ports of a firmware-27 dcpext, and since the previous commits of a firmware-27 DCP with Type-C routes, to the endpoint its firmware advertises. dptxep_init() still waited for a port announce softly only on a dcpext, so a Type-C-routed DCP whose ports are not announced yet would fail its start with -ETIMEDOUT instead of leaving the endpoint up for a later announce. Use the same condition in both places and say so in the dptx_endpoint comment. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at 5029465. Since 1c33c3b the only change is one added commit, 5029465, which updates the 1/2. Overloading New: 5029465 fixes the host test at the head, but 1c33c3b alone still fails to compile the harness, so bisect is red in the tests only. Fold the test commit into 1c33c3b the next time the series is respun. Do not force-push just for that. There are no agent trailers, and no new gates or parameters. Verdict: NITS. Merge only together with or after linux#2853, which admits the T8112 27.2 DCP; without it this PR is inert on the J473. After that, a J473 row on a tip build with both (RyanTheTide/lab) is needed: USB-C connect, modeset, unplug/replug, and HDMI in the same boot. A smoke row on one firmware-27 dcpext Mac (J615 or J616s USB-C DP) would confirm that the unchanged paths really are unchanged. |
|
Review fixes pushed (fast-forward, no rebase):
Host: run-host-tests --only atc 13/13, --only dcp 35/35, --only dptx 5/5. Default-cmdline row, Mac mini M2 (J473, 27.2), kernel = fleet82 + #2853 + this PR's head, production Stage 2, 4 boots: Enforcing, 0 AVC, 0 WARN/oops/DART faults; the only failed unit is aurora-sep, which also fails on the production kernel. Both DCPs bound; the primary allocates its Type-C DPTX PHY. No DP monitor was driven in these boots (the DPMS/MCDP rows are tracked for #2853). The s2idle hard reset on this kernel (control resets on the first freeze) is fixed separately in #2953, the DP audio domain being cut under the running primary DCP. It is not caused by this PR. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 re-review at live head 612c36f4405f41a047271d6c2aeecce90157a465 (delta 5029465c33..612c36f440, CI green: host-tests).
Verification of Fixes Since 5029465c33
- Prior Nit 1 (
-EOPNOTSUPPoverloading indptx-drive-v27.inc): Fixed cleanly in821328e5.atcphy_dpphy_configure()now accepts a drive-only request (opts->set_voltages && !opts->set_rate && !opts->set_lanes) on T8103-generation PHYs withdev_dbg+return 0(matching the T8132 branch), keeps-EINVALfor combined rate/lane + voltage requests, anddptxport_call_drive_v27()is back to passing everyphy_configure()error unchanged to DCP. - Prior Nit 2 (
dptxep_init()/dcp-internal.hcondition drift): Fixed cleanly in612c36f4.dptxep.c:1677-1678now checks(dcp->fw_compat == DCP_FIRMWARE_V_27_0 && (dcp->dcpext || dcp->nr_typec_routes)), and thedcp-internal.h:318-319comment is aligned. - Prior Nit 4 (host test coverage): Fixed cleanly with
tools/asahi/atc-dp-drive-tests.py+ 3 mutations inrun-host-tests.py, and CIhost-testspassed at612c36f440. - Prior Blocker 1 (default-cmdline regression row): Partially addressed — the 4-boot J473 production-Stage-2 default-cmdline health row (Enforcing, 0 AVC, 0 WARN/oops/DART faults, 0 new failed units) is now recorded, but without a DP monitor driven on this head (see Blocker 1 below).
Checklist Summary
- §1 No model gating: Pass.
- §2 Production-ready: Pass (code is clean and default-cmdline).
- §3 Safety: Pass.
- §4 Clean-room & attribution: Pass. All 6 commits (
9cbc00e0..612c36f4) carry human author/committer (Ryan Murray) andSigned-off-by:, zero AI trailers in commits; PR body ends withAssisted-by:. - §5 Evidence: Fail (see Blockers 1 & 2).
- §6 Naming: Pass.
Remaining Blockers
- §5 — Exact-head USB-C DP display verification owed after
821328e5+612c36f4: The 4-boot default-cmdline row posted for612c36f4explicitly notes "No DP monitor was driven in these boots". Since821328e5replaced the-EOPNOTSUPPhandling inatc.c/dptx-drive-v27.incand612c36f4changeddptxep_init(), please run a default-cmdline USB-C DP connect/modeset (+ simultaneous HDMI) row on the live head612c36f4to prove the final code on hardware. - §5 / Merge-train dependency (
#2853still OPEN andDIRTY):aurora-silicon/linux#2853(e2cc4ab5) is still OPEN (mergeStateStatus: DIRTY,CHANGES_REQUESTED). Without#2853landed, this series remains inert onintegration/auroratip. Keep gated on#2853landing (or stack/integrate cleanly with it) before merge.
Non-blocking nits
- Stale PR body:
## Changein the PR description still describes the superseded-EOPNOTSUPPmechanism inphy: apple: atcanddrm/apple: dptx; please update it to match821328e5. - Bisect gap in host tests:
1c33c3b8still breaksdcp-v27-dptx-layout-tests.pycompilation until5029465c(no need to force-push for this alone).
Assisted-by: LLM (Gemini 4 Neon)
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at 612c36f4405f. The updated source propagates PHY errors and admits layout from the Type-C route. The posted boot-health result does not exercise the drive-only callback on the current head. Please include USB-C DP modeset plus simultaneous native HDMI on the integrated #2853 stack, and a peer disconnect/retrain case over s2idle before treating the newly enabled route as ready.
|
I rechecked the archived J473 USB-C DPMS runs on the earlier #2853 + #2868 stack, with the default command line and a USB-C to HDMI adapter. The failure was a live-boot link loss: the first USB-C wake accepted the ACTIVE commit, then link configuration timed out and the EDID stayed empty. The failed boot recorded 48 DPTX link-fault reports and six RemotePort timeouts. The second boot recovered USB-C after every tested cycle and recorded zero of either error. The two boots used different orderings. In the failing boot, USB-C was powered off 4.420 s after HDMI returned. In the passing boot, USB-C was exercised first. This leaves order as a variable to control in the combined-head test. Six later ACTIVE=1 ioctls returned EINVAL in the failed boot. The old shell helper used an unqualified wait and printed dpmsprobe_rc=0 for all six. I corrected the helper and verified that it records success, failure and timeout separately. The combined hardware row should require a real EDID and measured flips after wake in addition to a successful ioctl. |
|
Host verification at The earlier J473 default-command-line DPMS logs narrow the remaining hardware check. On boot 1, six HDMI-only atomic cycles completed. The first USB-C-only cycle returned from the CRTC commit but the USB-C link lost its EDID and did not relight. Six subsequent two-output attempts reported Those two boots predate the final ATC and DPTX review fixes. The live-head row still needs both sinks, with USB-C-first and HDMI-first cycles distinguished and a post-cycle EDID and flip check. Assisted-by: LLM (Codex) |
|
I replaced the sequential KMS check for the remaining J473 row with one atomic modeset on separate HDMI and USB-C CRTCs. The probe keeps both scanout buffers allocated and waits for a flip completion from each CRTC. It repeats that check after USB-C-only DPMS, HDMI-only DPMS, USB-C DPMS after HDMI, and both outputs cycling together. On physical outputs it also compares the EDID bytes after each wake, before any recovery modeset. The probe passed all five paired flip phases in a KVM guest with two VKMS CRTCs. Each phase returned 120–121 events per output in about two seconds. It rejected both the same-connector case and an unadvertised mode. The static arm64 probe built with This validates the test fixture. The J473 combined hardware row still needs both physical links on the default command line, including the EDID check. Assisted-by: LLM (Codex) |
|
J473 (Mac mini M2, 27.2) row at this head Both monitors came up under apple-drm, with no simpledrm. The USB-C output went through an Apple USB-C Digital AV adapter (MCDP2900) to an MSI MPG 325CQRXF, and the native HDMI port drove an Acer QG270 S3. The guarded one-shot then restored fleet85 and verified it.
Still open, and not caused by this series: J473 s2idle resets whenever a 27.2 DCP driver is bound. That applies to both the adopted and the cold paths, with #2953 v1 or v2, and on yesterday's f82 kernel too. It is tracked on #2853. Rows and files
Assisted-by: LLM (Claude:Opus 5.5) |
|
MERGETRAIN6 source review at Merge still depends on closing the J473 s2idle reset from the integrated DCP path in #2853. Recheck USB-C disconnect and retrain with the PHY hold included, and cover the existing shared DPTX path on a regression Mac. Assisted-by: LLM (Codex) |
|
J473 combined hardware row at Assisted-by: LLM (Codex) |
Problem
On the M2 Mac mini (J473) with the 27.2 stub, the primary DCP serves the USB-C ports. It used the default DPTX endpoints and timed out on startup. After correcting the endpoints, link training still restarted because the PHY rejected the firmware's drive-only requests.
Change
Choose the firmware-advertised DPTX endpoints for a DCP whose device tree describes Type-C display routes. A drive-only request on a PHY without programmable drive levels leaves its existing settings in place and succeeds. A combined voltage and rate or lane request is rejected, and the DPTX handler passes PHY errors through unchanged.
Testing
At head
612c36f4405f, GitHub host tests passed. J473 booted four times on fleet82 plus this head and the 27.2 DCP admission series, using production Stage 2 and the default command line. Both DCPs bound and the primary allocated its Type-C PHY. SELinux was Enforcing, with zero AVCs, warnings or DART faults. The existingaurora-sepunit failure also occurred on the production kernel.An earlier revision drove the USB-C display at 2560×1440 and 144.00 Hz, with native HDMI running at 180.00 Hz in the same boot. A connected-display rerun is pending at the current revision.
Still to run
Repeat a USB-C modeset with simultaneous native HDMI on the integrated kernel, followed by DPMS relight and a USB-C peer reconnect. The series depends on the 27.2 DCP admission change. The DP-audio suspend fix is tracked separately.
Host checks and earlier modeset
612c36f4405f: DPTX layout 5/5, ATC drive 4/4, DPTX 5/5 and RTKit handover 21/21 in the focused host runs. The late-service handling now covers eligible primary DCPs with Type-C routes.The modeset investigation and earlier PR draft used Claude Opus 5.5.
Assisted-by: LLM (Codex)