Skip to content

drm/apple, phy: apple: light a USB-C display from a firmware-27 DCP on a T8103-generation ATC PHY - #2868

Merged
RyanTheTide merged 6 commits into
integration/aurorafrom
m2mini/fw27-typec-dp
Nov 24, 2026
Merged

RyanTheTide merged 6 commits into
integration/aurorafrom
m2mini/fw27-typec-dp

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown

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 existing aurora-sep unit 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
  • Head 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.
  • Earlier USB-C run: 35 modes and a 256-byte EDID matching the same adapter route on macOS 27.2, 721 flips in 5 s at 2560×1440. The native HDMI sink measured 180.00 Hz. The final drive-only callback changes were made after this row.
  • The earlier adapter route exposed no VRR capability on either OS. That result applies to the tested adapter and sink path.

The modeset investigation and earlier PR draft used Claude Opus 5.5.

Assisted-by: LLM (Codex)

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

Copy link
Copy Markdown
Author

Review at 1c33c3b.

The endpoint and PHY parts look right. Selection goes through the DT (typec-routes on a non-dcpext DCP; at this head only t8112-j473.dts &dcp has them) and the PHY compatible (the tail of atcphy_dpphy_configure() runs only for apple,t8103-atcphy, i.e. T8103/T8112/T600x/T602x). The change adds no delays, retries or parameters, and it does not touch USB, typec mux or suspend paths, since atcphy_dpphy_configure() is reached only through the DP phy_ops.

  1. dptx-drive-v27.inc:111 now treats every -EOPNOTSUPP from phy_configure() as "this PHY keeps its levels". Other code returns that errno with different meanings. The phy core returns it when a PHY has no .configure. atc.c:4923 returns it on T8132 when DP alt mode is not up (!atcphy_t8132_dp_on()). On T8132 a drive request while DP is off used to fail and now succeeds silently. The PR text lists only T8122/T6050 as "not touched".
  2. Simpler, and with no errno overloading: do what the T8132 branch already does (atc.c:4925-4929). For a drive-only request on these PHYs, dev_dbg() and return 0. Keep -EINVAL for set_voltages together with set_rate (nobody sends that combination). Then dptx-drive-v27.inc needs no special case, and a real "DP not on" error still fails the call.
  3. Nit: with the levels fixed, DCP still steps through the full 3/3 range that get_max_drive_settings advertises (dptxep.c:321-322), which is the nine steps in the log. This is unchanged from pre-27, so it is fine for this PR. It is worth a follow-up so that a PHY without drive control advertises 0/0.
  4. Rows owed at this head:
    (a) J473 USB-C DP on fw 27.2 on the default cmdline (the row above had dyndbg);
    (b) a fw-27 USB-C DP row on a second t8103-atcphy Mac that takes the v27 drive handler through a dcpext (J293/J313 or J413, plus J314/J316 or J414/J474 if any of them runs a 27.x stub);
    (c) a J473 row on a pre-27 stub for the primary USB-C path (the fw_compat gate should make it a no-op);
    (d) if (1) stays as written, a J713 USB-C DP plug/unplug row on fw 27.
    A USB3 enumeration plus hotplug smoke on one T8103-generation port is enough for USB, since no USB code changed.

…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>
@RyanTheTide

Copy link
Copy Markdown
Author

Review at 5029465: no blockers.

Adversarial pass at this head (4 commits on 110861f). Code read plus host tests: dcp-v27-dptx-layout-tests.py passes (576 cases) and its 4 mutations fail as intended; run-host-tests.py --only dptx 5/5, --only atc 9/9, --only dcp 35/35. No kernel build or hardware in this pass.

Before merge:

Nits (none block):

  1. dptx-drive-v27.inc:111 treats any -EOPNOTSUPP as "no drive control". The only other source today is the T8132 "DP not up" return (atc.c:4924), and T8132 DCPs are pinned to the M4 firmware path, so that case can't happen yet. Returning 0 from the PHY for a drive-only request, or a comment naming the one producer, would make that explicit.
  2. 1c33c3b alone breaks the layout host test (the harness only builds again at 5029465). This is a bisect gap in tests only.
  3. No host test covers the new -EOPNOTSUPP branch in the drive handler.

Other Macs: the typec-routes layout selection only changes the J473 &dcp. Every other owner is an apple,dcpext node (condition unchanged) or is pinned to M4/H17P firmware. -EOPNOTSUPP is new only for apple,t8103-atcphy-generation PHYs. T6050, T6040, lpdptx and T8122 configure paths never return it. No new gates, params or delays.

Full review

VERDICT: NO BLOCKERS

Reviewed at head 5029465 (4 commits on merge-base 110861f, base tip e0a9448).
No code blocker found. Two merge conditions are not code defects but must hold before it lands (see "Merge conditions").
Line numbers are those of the PR head.

What was checked and how

  • Read the full diff and the surrounding code in drivers/phy/apple/atc.c, drivers/gpu/drm/apple/{dcp.c,dptxep.c,dptx-drive-v27.inc,dptx-j700-training.h,afk.c,apple_drv.c,dcp-fabric.c}, drivers/phy/apple/{atc-t6050-dp.c,t6040-usb2.c,dptx.c,atc-j700-dp.h}, drivers/phy/phy-core.c.
  • Enumerated every typec-routes node in arch/arm64/boot/dts/apple and the compatible of its owning DCP node (script, 39 nodes).
  • Host tests run locally at head: dcp-v27-dptx-layout-tests.py PASS (576 cases), the 4 mutations each FAIL as intended; run-host-tests.py --only dptx 5/5, --only atc 9/9, --only dcp 35/35. CI host-tests on the PR: SUCCESS.
  • Not done: no kernel build, no hardware.

1. Correctness

-EOPNOTSUPP does not leak to a caller that treated -EINVAL specially.
The changed return (atc.c:4957-4958) is reached only for PHYs that are not T8132 generation (4922), not has_t8140_dp (4946) and not dp_t8122 (4949), i.e. only atcphy_hw_t8103 (apple,t8103-atcphy, with the t8112/t6000/t6020 fallbacks). Callers of phy_configure() with set_voltages:

  • dptx-drive-v27.inc:101-105: the one this PR changes.
  • dptx-j700-training.h:54-57: any error still fails. It is reached only through dptxport_v2_group_call(), which dptxport_group_call() enters only for dcp_is_external_h17p() (dptxep.c:1361-1363); that profile is set only in apple_dcp_hw_t8140_external (dcp.c:9991), whose PHY takes j700_dp_configure(). So a T8103-generation PHY cannot reach it, and afk.c:1194's "no handler for compact service" warning for -EOPNOTSUPP cannot be triggered by the new errno.
  • dptxep.c:513 (set_lanes) and dptxep.c:687 (set_rate) pass dptx->phy_ops, whose set_voltages is only ever written 0 (dptxep.c:582). The existing ret == -EOPNOTSUPP && !phy_link_rate special case at dptxep.c:694 is therefore not reached by the new return.
  • The native-26 path answers SetDriveSettings with -EOPNOTSUPP itself (dptxep.c:1219-1220) and never calls the PHY for it.
  • Pre-27 firmware: dptxport_call_set_drive_settings() (dptxep.c:367-389) only records the levels and never calls the PHY. The dispatch to the v27 handler is fw_compat == DCP_FIRMWARE_V_27_0 (dptxep.c:1051-1058). Unchanged.

Other sources of -EOPNOTSUPP that the handler now swallows (dptx-drive-v27.inc:111). Checked every .configure a dcp->phy can have (dptx->atcphy = dcp->phy, dcp.c:2395, 2986):

  • t6050_dp_configure() (atc-t6050-dp.c:659-708): returns -EINVAL/-EIO/-EPIPE, never -EOPNOTSUPP. M5 unchanged.
  • t6040_dp_configure() (t6040-usb2.c, ends ~1932): no -EOPNOTSUPP on the configure path. J616s unchanged.
  • dptx_phy_configure() (dptx.c): the file has no -EOPNOTSUPP at all. HDMI DCPs unchanged.
  • atcphy_dpphy_configure_t8122() / atcphy_dp_set_drive_t8122() (atc.c:4891-4907, 3796-3825): -ENOLINK/-EINVAL, no -EOPNOTSUPP. J615 unchanged.
  • T8132 (atc.c:4922-4924) returns -EOPNOTSUPP when DP alt mode is not up. This would now be answered as success. Not reachable today: apple,t8132-atcphy appears only in t8132.dtsi and t8132-atc23.dtsi, and both T8132 DCP hw records pin DCP_FIRMWARE_M4 (dcp.c:10049-10059), so dcp_start() returns at dcp.c:4687-4690 and the v27 drive handler is never dispatched. Latent only; see nit 1.
  • phy core returns -EOPNOTSUPP for a PHY without .configure (phy-core.c:563-564); all four DP PHY drivers have one.

Layout selection (dcp.c:4670-4671). dcp->dcpext is of_device_is_compatible(..., "apple,dcpext") (dcp.c:7277). Non-dcpext DCP nodes that own typec-routes in the tree:

  • t8112-j473.dts:69-79 &dcp (apple,t8112-dcp, apple,dcp): the intended target.
  • t8132-dcpext.dtsi:63,138 (apple,t8132-dcpext only, no apple,dcpext fallback; routes in t8132-j713-j715.dtsi:198,251, t8132-j604.dts:453,518): DCP_FIRMWARE_M4, returns from dcp_start() before dcp_v27_dptx_layout() (dcp.c:4687-4690 vs 4724). Not affected.
  • t8140-j700-dcpext.dtsi:11 (apple,t8140-dcpext, apple,dcp): pinned DCP_FIRMWARE_H17P (dcp.c:9993), returned by dcp_check_firmware_version() before any 27.x mapping (dcp.c:6018-6019). Not affected.
  • Every other typec-routes owner (t600x, t602x, t6030, t6040/t6041, t6050, t8103, t8112-jxxx, t8122, t8142) is a node with the apple,dcpext compatible, for which the condition is unchanged. T6050 and firmware-27 T6041 dcpexts and T8142 dcpexts keep their pinned endpoint (dcp.c:10098, 7356, 10113).
    So for M1, M1 Pro, M2 Air, J615, J713, J616s, Neo and M5 the selection is unchanged at this head; verified from the DTs and hw records, not on hardware.

Error paths. With hw.dptx_controller now set for the J473 primary, a dptx_controller_init() failure returns an error from dcp_start() (dcp.c:4755-4760) where the old default-endpoint timeout was only a warning (dcp.c:4764-4766). apple_drm_init_dcp() treats a failed start per DCP as a warning (apple_drv.c:1657-1660), so the HDMI DCP is not taken down with it. Acceptable; same behaviour dcpexts already have.

Ordering. nr_typec_routes is filled by dcp_register_typec_routes() at dcp.c:7144/7699 (probe/bind), before dcp_start() runs from apple_drm_init_dcp(). A route whose PHY node is disabled is skipped (dcp-fabric.c:4860-4861), so such a DCP keeps the default endpoints, as before.

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; phy_configure() holds phy->mutex around it.

2. Binding rules

  • No new chip/SoC/board gate. atc.c uses the existing per-compatible hw record fall-through; dptx-drive-v27.inc keys on the PHY's answer; dcp.c keys on DT typec-routes.
  • The fw_compat != DCP_FIRMWARE_V_27_0 test in dcp_v27_dptx_layout() is pre-existing and is the driver's firmware-ABI dispatch (same enum that selects the v27 call tables at dptxep.c:1051-1058). The PR adds no new version check.
  • No module/cmdline parameter, no delay, no constant limit added.

3. Provenance

No 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 hygiene

All four commits: author and Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>, no Co-Authored-By / Assisted-by / agent trailers (checked full bodies of 9cbc00e, 2b316ee, 1c33c3b, 5029465). PR body ends with the Assisted-by: line.

Merge conditions (not code blockers)

A. Inert at the base tip without #2853. At this head a T8112 DCP with a 27.x apple,firmware-compat is not admitted: the generic tail of dcp_check_firmware_version() accepts only 12.3/13.5/14.7 (dcp.c:6109-6127) and returns DCP_FIRMWARE_UNKNOWN. #2853 (OPEN, head e2cc4ab) adds that admission. Until it merges, neither the layout change nor the drive-handler change can execute on the J473, and the hardware row in the PR body was taken on #2853 + this PR + an aura-try Stage 2 from aura#467, not on the tip. Merge after #2853 (or together) and rebuild the J473 default from the tip to prove it there.
B. Default-cmdline row owed. The PR body says the only hardware row had dyndbg for dptxep.c and the ATC PHY, and lists the default-cmdline row as still to run. dyndbg prints sit inside the link-training call path, so the row should be repeated without them before merge (production-ready rule).

Nits

  1. dptx-drive-v27.inc:111 gives a generic errno one meaning ("this PHY keeps its levels"). Today only atc.c:4958 can produce it on a firmware-27 DCP (see above), but atc.c:4924 (T8132, DP not up) and phy-core.c:564 use the same errno for different things; if a T8132 PHY ever sits behind a v27-dispatch DCP, a drive request with DP down would be answered as success. The earlier review comment on the PR (at 1c33c3b) proposed returning 0 from the PHY for a drive-only request, as the T8132 branch does at atc.c:4925-4929; either that or a comment at line 111 naming the one producer would close it. The prior comment's requested J713 row for this is not needed: the path is unreachable on T8132 (firmware M4).
  2. Bisect: 1c33c3b changes dcp_v27_dptx_layout() but the harness is fixed only in 5029465. Verified: at 1c33c3b tools/asahi/dcp-v27-dptx-layout-tests.py fails to compile (the stub struct apple_dcp has no nr_typec_routes), so host-tests is red at that commit. The kernel itself is unaffected. Squash the test commit into 1c33c3b if the series is respun; do not force-push for this alone.
  3. atc.c:4952-4956 and the commit message state these PHYs "have no drive level control". I could only verify that the driver has no drive-level code for this generation, not that the hardware lacks it. Wording such as "this driver does not set drive levels on these PHYs" would be safer.
  4. dptxep.c:1675-1676 keeps the "not announced yet" soft return for fw27 && dcp->dcpext only. A primary DCP with Type-C routes whose ports are not announced within 1 s gets "DPTX transport ready but port N service not announced" and -ETIMEDOUT (warning at dcp.c:4764-4766) with the endpoint left up. Harmless, but the two conditions now differ.
  5. dcp-internal.h:318,324 still describe dptx_endpoint / dptx_controller as set by dcp_v27_dptx_layout() for "a firmware-27 dcpext" only.
  6. No host test covers the new branch in dptx-drive-v27.inc (no test includes that file; git grep finds it only in dptxep.c). A small harness case "PHY answers -EOPNOTSUPP: reply echoes the request, status 0; -EINVAL: call fails" would pin it.
  7. Follow-up already named in the PR comment: get_max_drive_settings still advertises 3/3 (dptxep.c:321-327) on a PHY that keeps its levels, hence the nine training steps.

Missing rows

  • J473, firmware 27.2, default cmdline, kernel built from the tip after drm/apple: adopt a DCP handed over running (M2 Mac mini HDMI on 27.2) #2853: USB-C DP connect, modeset, unplug/replug; HDMI on the other DCP in the same boot (condition B).
  • J473 on a pre-27 stub (if one is still installable): primary and HDMI unchanged (expected no-op via fw_compat).
  • A second T8103-generation ATC PHY Mac on a 27.x stub taking the v27 drive handler through its dcpext (M1 / M2 Air J413 / M1 Pro / M2 Pro class), once drm/apple: adopt a DCP handed over running (M2 Mac mini HDMI on 27.2) #2853 admits their DCPs: USB-C DP link training. None proven; the PR says no other fleet Mac takes the path today, and I found none in the DTs for the layout change, but the PHY errno + handler change applies to all of them.
  • Regression rows on firmware-27 Macs whose paths I verified unchanged only by reading code: J615 (T8122 dcpext), J616s (T6041 dcpext), M5 (T6050 dcpext) USB-C DP; J713 and the Neo are not on the v27 drive handler.
  • USB3 enumeration + hotplug on one T8103-generation port (no USB code changed; smoke only).

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 advertised DPTX_CONTROLLER_ENDPOINT and DPTX_ENDPOINT). No model/compatible gating. Cross-checking all Apple DTS files confirms that only t8112-j473.dts attaches typec-routes to a primary &dcp node; every other board puts typec-routes on apple,dcpext, so older firmware and other SoCs are unaffected.
  • atc.c & dptx-drive-v27.inc: On ATCPHY_GENERATION_T8103 (T8103/T8112/T600x/T602x), atcphy_dpphy_configure() returns -EOPNOTSUPP instead of -EINVAL for opts->set_voltages, and dptxport_call_drive_v27() treats -EOPNOTSUPP as "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) and Signed-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

  1. §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-only dyndbg enabled for dptxep.c and the ATC PHY (explicitly listed under ## Still to run) and omits 0 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 (no dyndbg, which perturbs link-training timing) with a full §5 regression check (0 SELinux denials, 0 failed units, 0 new kernel errors).
  2. §5 / Merge-train dependency (#2853 OPEN and DIRTY): At live head 5029465c on integration/aurora, dcp_check_firmware_version() (dcp.c:6108-6129) still rejects 27.x apple,firmware-compat for apple,t8112-dcp (DCP_FIRMWARE_UNKNOWN), making this series inert on tip without aurora-silicon/linux#2853 (currently OPEN with mergeStateStatus: DIRTY). The recorded J473 row also ran on #2853 + the first 3 commits + an unmerged aura#467 Stage 2 rather than an integrated tip build at live head 5029465c. Land or rebase onto #2853 and record a clean default-cmdline hardware row at the verified live head.

Non-blocking nits

  1. -EOPNOTSUPP overloading (dptx-drive-v27.inc:111): Treating any -EOPNOTSUPP from phy_configure() as "PHY keeps its tunable levels" conflates it with phy-core.c (missing .configure) and atc.c:4924 (T8132 returning -EOPNOTSUPP when !atcphy_t8132_dp_on()). Safe today because T8132 uses the M4 firmware path, not dptx-drive-v27.inc, but returning 0 (with dev_dbg) for a drive-only request on T8103-generation PHYs—matching the existing T8132 branch at atc.c:4925-4929—would avoid overloading -EOPNOTSUPP and keep dptx-drive-v27.inc free of errno special cases.
  2. 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 at dcp-internal.h:318 still says dcpext only.
  3. Host-test bisect gap: Commit 1c33c3b8 adds dcp->nr_typec_routes to dcp_v27_dptx_layout(), breaking tools/asahi/dcp-v27-dptx-layout-tests.py compilation until 5029465c. If respun, consider folding the harness update into 1c33c3b8.
  4. Host test coverage: Adding a small host-test case covering the -EOPNOTSUPP vs -EINVAL handling in dptx-drive-v27.inc would 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>
@RyanTheTide

Copy link
Copy Markdown
Author

Review at 5029465.

Since 1c33c3b the only change is one added commit, 5029465, which updates the dcp-v27-dptx-layout-tests.py stub for nr_typec_routes and adds a Type-C-route mutation. The three code commits are unchanged.

1/2. Overloading -EOPNOTSUPP in dptx-drive-v27.inc:111 is still as written. I am downgrading it from a change request to a nit. The adversarial pass at this head showed that the only other producer, atc.c's T8132 "DP not up" return, cannot reach the v27 drive handler today, because T8132 DCPs are pinned to DCP_FIRMWARE_M4. So the J713 row I asked for under 4(d) is not needed. I still prefer the PHY to return 0 for a drive-only request, as the T8132 branch already does. Failing that, a comment at line 111 naming atc.c as the one producer will do.
3. Advertising 0/0 max drive settings on a PHY that keeps its levels: still a follow-up, as agreed.
4. Rows: (a) The default-cmdline J473 row is now reported (USB-C 2560x1440@144.00 and @59.95, HDMI 180.00 Hz in the same boot). It ran on #2853 plus this PR plus an aura#467 Stage 2, not on a tip build. (b) A second T8103-generation ATC Mac on 27.x through a dcpext is still open, and the body says no other fleet Mac takes this path yet. (c) A J473 on a pre-27 stub, if one is installable, has not been run.

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.

@RyanTheTide

Copy link
Copy Markdown
Author

Review fixes pushed (fast-forward, no rebase):

  • 821328e phy: apple: atc: a drive-only request on PHYs without drive control is a no-op (dev_dbg, returns 0, same as the T8132 branch). A drive request together with a rate or lane change is refused with -EINVAL. dptx-drive-v27 now passes every PHY error back, with no special case for any errno. New host test: tools/asahi/atc-dp-drive-tests.py.
  • 612c36f dptxep_init(): a firmware-27 DCP with Type-C routes now gets the same soft "not announced yet" handling as a dcpext (Dj's nit 2), plus the dcp-internal.h comment.

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 DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 re-review at live head 612c36f4405f41a047271d6c2aeecce90157a465 (delta 5029465c33..612c36f440, CI green: host-tests).

Verification of Fixes Since 5029465c33

  • Prior Nit 1 (-EOPNOTSUPP overloading in dptx-drive-v27.inc): Fixed cleanly in 821328e5. atcphy_dpphy_configure() now accepts a drive-only request (opts->set_voltages && !opts->set_rate && !opts->set_lanes) on T8103-generation PHYs with dev_dbg + return 0 (matching the T8132 branch), keeps -EINVAL for combined rate/lane + voltage requests, and dptxport_call_drive_v27() is back to passing every phy_configure() error unchanged to DCP.
  • Prior Nit 2 (dptxep_init() / dcp-internal.h condition drift): Fixed cleanly in 612c36f4. dptxep.c:1677-1678 now checks (dcp->fw_compat == DCP_FIRMWARE_V_27_0 && (dcp->dcpext || dcp->nr_typec_routes)), and the dcp-internal.h:318-319 comment is aligned.
  • Prior Nit 4 (host test coverage): Fixed cleanly with tools/asahi/atc-dp-drive-tests.py + 3 mutations in run-host-tests.py, and CI host-tests passed at 612c36f440.
  • 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) and Signed-off-by:, zero AI trailers in commits; PR body ends with Assisted-by:.
  • §5 Evidence: Fail (see Blockers 1 & 2).
  • §6 Naming: Pass.

Remaining Blockers

  1. §5 — Exact-head USB-C DP display verification owed after 821328e5 + 612c36f4: The 4-boot default-cmdline row posted for 612c36f4 explicitly notes "No DP monitor was driven in these boots". Since 821328e5 replaced the -EOPNOTSUPP handling in atc.c/dptx-drive-v27.inc and 612c36f4 changed dptxep_init(), please run a default-cmdline USB-C DP connect/modeset (+ simultaneous HDMI) row on the live head 612c36f4 to prove the final code on hardware.
  2. §5 / Merge-train dependency (#2853 still OPEN and DIRTY): aurora-silicon/linux#2853 (e2cc4ab5) is still OPEN (mergeStateStatus: DIRTY, CHANGES_REQUESTED). Without #2853 landed, this series remains inert on integration/aurora tip. Keep gated on #2853 landing (or stack/integrate cleanly with it) before merge.

Non-blocking nits

  1. Stale PR body: ## Change in the PR description still describes the superseded -EOPNOTSUPP mechanism in phy: apple: atc and drm/apple: dptx; please update it to match 821328e5.
  2. Bisect gap in host tests: 1c33c3b8 still breaks dcp-v27-dptx-layout-tests.py compilation until 5029465c (no need to force-push for this alone).

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RyanTheTide

Copy link
Copy Markdown
Author

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.

@RyanTheTide

Copy link
Copy Markdown
Author

Host verification at 612c36f4405f: a provisional integration tree adds this head, the live-DCP handover, the DP-audio sleep fix at 19f90d0e8a3a, and the display-DART fix. Apple DCP host coverage was 93/93 across bounded runs on the same tree.

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 EINVAL on the ACTIVE=1 commit despite the wrapper recording zero. On boot 2, which started with USB-C DPMS, all seven atomic cycles completed, followed by 144.00 Hz flips on USB-C and 179.60 Hz on HDMI. Neither boot reset.

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)

@RyanTheTide

Copy link
Copy Markdown
Author

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 -Wall -Wextra -Werror.

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)

@RyanTheTide

Copy link
Copy Markdown
Author

J473 (Mac mini M2, 27.2) row at this head 612c36f4405f, on the default command line and the J473's production Stage 2 (aura main f13056d9, promoted today), with the kernel integration/aurora 0f111a0d + this series + #2853 (with its integration/aurora merge 372f94c0) + #2953. The Fedora 7.3 config is the same as fleet85.

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.

  • Paired atomic modeset on both CRTCs: HDMI 143.90 Hz and USB-C 144.00 Hz. DPMS off/on relit both outputs (144.01 / 144.00 Hz).
  • USB-C DP-2 alone: 2560×1440 at 144.00 Hz (721 flips in 5 s), the highest rate macOS 27.2 offers for this sink on this Mac (MaximumRefreshRate 144). The EDID was 256 bytes and named the monitor "MPG 325CQRXF".
  • HDMI alone: 1920×1080 at 180.00 Hz, which matches macOS (MaximumRefreshRate 180).
  • HDR modeset at 1440p60 on USB-C: the DCP chose 12 bpc PQ.
  • Enforcing, 0 AVC denials, 0 failed units.

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
  • Evidence: our lab store, traces/display/20261124-m2mini-display-full/r1b (3-display.txt has the probe output, and 9-restored.txt has production verification).
  • The runner is run-j473.sh, the M2-DISPLAY runner adapted for this row: a non-default BLS entry with fleet85's options copied unchanged, then grub2-reboot one-shot, a dead-man and restore.
  • Neither OS offers VRR on these two sinks on this Mac (SupportsVariableRefreshRate No on macOS, vrr_capable 0 on Linux).

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Author

MERGETRAIN6 source review at 612c36f4405f. Blocking: none in this diff. Layout selection follows the firmware's advertised endpoints and DT routes. PHY errors propagate to the drive handler. The J473 hardware row verifies simultaneous HDMI and USB-C modesets on the default command line.

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)

@RyanTheTide

Copy link
Copy Markdown
Author

J473 combined hardware row at 612c36f4405f. J473 exercised the signed combined kernel adec412c0223 and Stage 2 735f11c86f88 on the default command line. HDMI and USB-C DP were connected and enabled before and after 3/3 same-boot suspend cycles. The display matrix and shared output regressions remain open. Combined run and source receipt

Assisted-by: LLM (Codex)

@RyanTheTide
RyanTheTide merged commit e1826fa into integration/aurora Nov 24, 2026
1 check passed
RyanTheTide added a commit that referenced this pull request Nov 24, 2026
Takes linux#2853, #2868 and #2953. The only conflict is the host-test
registry, where both sides add entries.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.

2 participants