Skip to content

kboot: display routes: match a port's PD controller by port type too - #558

Merged
RyanTheTide merged 2 commits into
mainfrom
fix/display-routes-port-type
Nov 30, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
fix/display-routes-port-type

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: The ADT route writer now matches a port's PD controller on port-type as well as port-number. On the 14-inch M5 Pro MacBook Pro (K114s) the left-back USB-C controller, the MagSafe 3 controller and the HDMI output all carry port-number 1, so the left-back port got "2 PD controllers" and no route.

Tested: Host tests (17 route tests; the new one fails without the fix). Offline on the real K114s ADT (27.2) with the current K114s tree: the written DTB is byte-identical (left-front and right routed as before); port 1 now resolves to hpm0 and stops at "its ATC PHY is not described for Linux", which is what the tree says. K114s boot row with this in the Stage 2: pending.

Risk: two-way · T6050 machines whose tree asks for ADT routes (K114s, K116s, J775d). Only machines whose ADT has port-type on both the output and the controller see any change.

Not yet: K114s boot row at the head. The stage1-size gcc job fails as it does on main ca833980 with the same number (stage1 3,696 B < 4,096 B floor, reproduced in an Ubuntu 24.04 cross container); this PR adds no .text byte (.rodata 240 B, 27,640 B left).

Details

Port numbers count per port type in the ADT (/port-usb-c-1, /port-hdmi0, /port-magsafe3-1 each have their own port-number 1). The writer takes a controller only if its port-type equals the output's, when both name one. Outputs or controllers without a port-type match as before, so older ADTs behave the same. Nothing depends on the chip or the board.

K114s ADT: atc0-dpphy port-type 2 port 1, nub-spmi-a0/hpm0 port-type 2 port 1 (left-back), nub-spmi-a0/hpm5 port-type 17 port 1 (MagSafe, transports-supported empty), atc3-dpphy port-type 6 port 1 (HDMI).

Evidence
  • pytest tests/python/test_dcp_typec_routes_adt.py tests/python/test_dcp_typec_routes.py: 15 passed; test_another_port_type_with_the_same_number_is_not_the_controller fails on main.
  • Offline run (routes_offline.py: the writer built for the host over the K114s ADT dump + the K114s DTB): before port 1: 2 PD controllers in the ADT, not one: no route on all four dcpext; after port 1: its ATC PHY is not described for Linux: no route; output DTB cmp-identical.
  • clang-format 20.1.8 --dry-run --Werror clean.

The ADT numbers ports per port type. On the 14-inch M5 Pro MacBook Pro
(K114s) the left-back USB-C port's controller (hpm0, port-type 2) and the
MagSafe 3 controller (hpm5, port-type 17, no transports) both carry
port-number 1, and the HDMI output (atc3-dpphy, port-type 6) does too. The
route writer took any controller with the output's number, found two for
the left-back port and gave it no route.

Take a controller only if its port-type matches the output's, when both
name one. Outputs or controllers without a port-type match as before.

On the K114s ADT (27.2) with the current K114s tree the written tree is
byte-identical (ports 2 and 3 routed as before); port 1 now resolves to
hpm0 and stops at "its ATC PHY is not described for Linux", which is
what the tree says.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

K114s pre-check row (no monitor on the HDMI port yet), 2026-11-29 01:53. One boot of a Stage 2 built from Ryan's default (aura e2a8cf9 + #558 + #559, plus the DTB with linux#3497 and #3498) on kernel 7.3.0-k114sstack3:

  • dcpext0 is HDMI-A with phy-names = dp-phy typec0 typec1 and mux-control-names = dp-xbar typec0 typec1. ATC3 (apple,t6050-dp-phy) is bound with all 9 tunables. HDMI-A-1 and its HDMI audio card are registered; HPD reads 0 (no cable).
  • acio1 is bound (thunderbolt-apple-acio) and pcie-tunnel-1 is present. The left-front port holds a DP-alt dock, so there's no tunnel yet.
  • Regression: the dock monitor on the left-front port runs 1920x1080@180 and the panel 3024x1986@120. No kernel warning beyond the previous default boot's set.

Still to do: an HDMI monitor on the HDMI port, and a TB5 enclosure on the left-front port.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

K114s HDMI row (2026-11-29). The HDMI port works with this PR's stack: #3497 + #3498 (DT), aura#558 + aura#559 (Stage 2), plus linux#3591, which starts the fixed ATC3 DP PHY that nothing started before (link faults 22/24 otherwise). MSI MPG 325CQRXF on the K114s HDMI port:

  • The first connect trains HBR3 on 4 lanes. gnome-shell drives 2560x1440@60 (XR30), with 35 modes up to 3840x2160, 0 link faults and 0 DCP crashes.
  • dcpext0 is a hybrid (dp-phy, typec0, typec1). The dock monitor on the left-front Type-C port keeps working on the same boot.
  • HDMI-CEC registers on the HDMI connector (/dev/cec0, physical address 2.0.0.0 = the monitor's HDMI 2 input), and the monitor answers.

Still to do: the left-front TB enclosure (PCIe tunnel through acio1, #3497). That needs the enclosure moved to the left-front port.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 29, 2026 03:20
@RyanTheTide
RyanTheTide requested review from a team as code owners November 29, 2026 03:20

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at e11535d2 (after re-running stage1-size CI on post-#551 main)

Blockers: none in code (re-run the pre-#551 gcc/fedora/nix Stage 1 size jobs against current main and wait for pr-text/readiness to go green before merging)

Checked:

  • src/kboot_display_routes.c:
    • dcp_typec_facts_from_adt() reads port-type from the ADT output node (defaulting to ~0U when absent) and passes it to adt_port_controller().
    • adt_port_controller() skips controllers whose port-type is present and differs from type, preventing MagSafe (port-type 17) or HDMI (port-type 6) nodes sharing port-number 1 from colliding with USB-C (port-type 2), while staying backward-compatible when either side omits port-type.
    • Function stays in ROUTES_TEXT (.rodata.xtext), adding 0 B to Stage 1 .text.
  • tests/python/test_dcp_typec_routes_adt.py: test_another_port_type_with_the_same_number_is_not_the_controller covers the port-type filter without regressing test_contradictory_adt_routes_nothing_on_that_port.
  • K114s Stage 2 hardware rows (2026-11-29, with aura#559 + linux#3497/#3498/#3591): HDMI-A-1 trains HBR3 4 lanes (2560x1440@60, /dev/cec0 at 2.0.0.0, 0 link faults, 0 DCP crashes) while left-front Type-C dock DP stays working; offline K114s ADT check confirms cmp-identical DTB on current tree and resolves port 1 to hpm0.
Evidence
  • Head: e11535d226e2 (MERGEABLE on main, +32/-8, 2 files).
  • CI at review time: 18 checks passing; gcc, fedora, and nix failed on 2026-11-28 against pre-#551 main strictly on the Stage 1 4,096 B floor (matching main's own headroom); pr-text and readiness queued/pending.
  • Merge note: aura#558 and aura#559 both insert a test before test_a_tree_without_the_request_is_untouched in tests/python/test_dcp_typec_routes_adt.py, so whichever merges second will need a trivial test-file merge.

@github-actions github-actions Bot added blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at 576f3f1a: not ready yet

Check Detail
CI at head ok 28 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 576f3f1a, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · T6050 machines whose tree asks for ADT routes (K114s, K116s, J775d). Only machines whose ADT has port-type on both the output and the controller see any change.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged main (post-#570) into the branch at 576f3f1, clean, no conflict, normal push. This re-runs the gcc/fedora/nix jobs that failed on the pre-#570 base.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at 576f3f1a. App approved (NEON-PR-REVIEW2), hosted CI green, rows in the body. Merges under the 6-point rule 1 h from now unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule at 576f3f1a. (1) The review App approved at this head. (2) CI is green. (3/4) Rows: App+CI Tested: Host tests (17 route tests the new one fails wi. (5) No blocking review. (6) Dj was pinged 61 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit e90ca19 into main Nov 30, 2026
29 checks passed
@RyanTheTide
RyanTheTide deleted the fix/display-routes-port-type branch November 30, 2026 02:55
@RyanTheTide RyanTheTide mentioned this pull request Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant