Repository navigation
kboot: display routes: match a port's PD controller by port type too - #558
Conversation
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>
|
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:
Still to do: an HDMI monitor on the HDMI port, and a TB5 enclosure on the left-front port. |
|
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:
Still to do: the left-front TB enclosure (PCIe tunnel through acio1, #3497). That needs the enclosure moved to the left-front port. |
There was a problem hiding this comment.
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()readsport-typefrom the ADT output node (defaulting to~0Uwhen absent) and passes it toadt_port_controller().adt_port_controller()skips controllers whoseport-typeis present and differs fromtype, preventing MagSafe (port-type 17) or HDMI (port-type 6) nodes sharingport-number 1from colliding with USB-C (port-type 2), while staying backward-compatible when either side omitsport-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_controllercovers the port-type filter without regressingtest_contradictory_adt_routes_nothing_on_that_port.- K114s Stage 2 hardware rows (
2026-11-29, withaura#559+linux#3497/#3498/#3591):HDMI-A-1trains HBR3 4 lanes (2560x1440@60,/dev/cec0at2.0.0.0, 0 link faults, 0 DCP crashes) while left-front Type-C dock DP stays working; offline K114s ADT check confirmscmp-identical DTB on current tree and resolves port 1 tohpm0.
Evidence
- Head:
e11535d226e2(MERGEABLEonmain,+32/-8, 2 files). - CI at review time: 18 checks passing;
gcc,fedora, andnixfailed on 2026-11-28 against pre-#551mainstrictly on the Stage 1 4,096 B floor (matchingmain's own headroom);pr-textandreadinessqueued/pending. - Merge note:
aura#558andaura#559both insert a test beforetest_a_tree_without_the_request_is_untouchedintests/python/test_dcp_typec_routes_adt.py, so whichever merges second will need a trivial test-file merge.
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
|
Merging under the 6-point rule at |
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-sizegcc job fails as it does on mainca833980with the same number (stage13,696 B < 4,096 B floor, reproduced in an Ubuntu 24.04 cross container); this PR adds no.textbyte (.rodata240 B, 27,640 B left).Details
Port numbers count per port type in the ADT (
/port-usb-c-1,/port-hdmi0,/port-magsafe3-1each have their ownport-number 1). The writer takes a controller only if itsport-typeequals 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-dpphyport-type 2 port 1,nub-spmi-a0/hpm0port-type 2 port 1 (left-back),nub-spmi-a0/hpm5port-type 17 port 1 (MagSafe,transports-supportedempty),atc3-dpphyport-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_controllerfails on main.routes_offline.py: the writer built for the host over the K114s ADT dump + the K114s DTB): beforeport 1: 2 PD controllers in the ADT, not one: no routeon all four dcpext; afterport 1: its ATC PHY is not described for Linux: no route; output DTBcmp-identical.--dry-run --Werrorclean.