Skip to content

t6040: enable the AOP pin controller for the USB4 routers, not only with the HDMI chain - #2371

Draft
RyanTheTide wants to merge 2 commits into
mainfrom
hdmicec/pinctrl-aop-supplier
Draft

RyanTheTide wants to merge 2 commits into
mainfrom
hdmicec/pinctrl-aop-supplier

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the J614s (T6040, M4 Pro 14") the three USB4 routers (apple,t6040-usb4-acio, 381ac0000.cio, 389ac0000.cio, 391ac0000.cio) stay in devices_deferred with "(reason unknown)", so the update-m1n1 commit check refuses the Stage 2 trial.

Each router has pinctrl-0 = <&usb4_N_lstx_pins>, and those pins are in the AOP pin controller (pinctrl@510824000). t604x.dtsi ships that node disabled. The only thing that enabled it was the display gate, as one node of the staged T6041 HDMI chain, which is applied only when the boot loader has handed the HDMI display processor over and every chain node is still disabled. Without that handover pinctrl_bind_pins() returns -EPROBE_DEFER for good and records no reason. The J616s routers bind only because its HDMI chain is handed over.

The pin controller was in the chain only because the HDMI converter's hotplug input (hdmi-hpd-gpios) is one of its pins. Nothing about it needs the display handover: its probe writes no pin register, and each consumer sets up only its own pins. The original "needs an ownership handoff" note in t604x.dtsi had no transfer behind it.

Change

  • display-gate: the AOP pin controller is no longer a node of the T6041 HDMI chains (J616s, J614s, J614c/J616c, J575c). An enabled one no longer makes the "every node still disabled" check refuse the chain. The chain instead enables the pin controller named by its display processor's hdmi-hpd-gpios, in the same changeset, if it is still disabled. The J614c/J616c and J575c, whose trees leave it off, get it with HDMI as before. The other checks are unchanged: firmware memory, the other nodes still disabled, and the whole chain or nothing.
  • dts: the J614s and J616s, which enable the routers, enable pinctrl_aop with them. The t604x.dtsi comment now says who enables it.
  • KUnit: the J616c test tree gets the converter's hotplug GPIO. A new case checks that an already enabled pin controller does not refuse the HDMI chain, and the existing cases check the pin controller state.

The gate change comes first, so no commit leaves the J616s HDMI chain refused.

Testing

  • DTBs for j614s, j616s, j616s-tether, j773s, j614c, j616c and j575c built with clang 22 and W=1. Comparing the dtc output before and after, the only change is pinctrl@510824000 going from disabled to okay on the J614s, J616s and J616s tether. The T6041 boards and the J773s are unchanged.
  • The ACIO pinctrl-0 phandles still resolve to pinctrl@510824000/usb4-{0,1,2}-lstx-pins.
  • The display-gate KUnit suites pass on qemu arm64 with LLVM: t6030, t6031, t8122, t6041 and t6041-max, 58/58 including the new gate_t6041_max_shared_pins case. That case fails against the old gate code (57/58): the HDMI chain is refused when the pin controller is already enabled.
  • checkpatch --strict is clean on both commits.

Still to run

  • J614s trial boot: devices_deferred empty, 510824000.pinctrl and the three ACIOs bound, and the update-m1n1 commit passes. This needs the reporter or a J614s owner.
  • J616s: HDMI and USB-C displays still handed over (no "already enabled, nothing changed" from the gate) and the ACIOs bound.

Fixes #2243

DTB evidence
pinctrl@510824000 status   before     after
t6040-j614s                disabled   okay
t6040-j616s                disabled   okay
t6040-j616s-tether         disabled   okay
t6040-j773s                disabled   disabled
t6041-j614c                disabled   disabled
t6041-j616c                disabled   disabled
t6041-j575c                disabled   disabled

t6040-j614s (same before/after; pinctrl_aop phandle 213, J616s 211)
cio@381ac0000 okay pinctrl-0=<274> -> pinctrl@510824000/usb4-0-lstx-pins lstx-gpios=<213 49 0>
cio@389ac0000 okay pinctrl-0=<281> -> pinctrl@510824000/usb4-1-lstx-pins lstx-gpios=<213 51 0>
cio@391ac0000 okay pinctrl-0=<288> -> pinctrl@510824000/usb4-2-lstx-pins lstx-gpios=<213 53 0>

…supplier

The T6041 HDMI chains (J616s, J614s, J614c/J616c, J575c) list the AOP pin
controller (pinctrl@510824000) as one of their nodes, so the gate both
enables it and refuses the whole chain when it is already enabled. It is
only there because the HDMI converter's hotplug input (hdmi-hpd-gpios of
the display processor) is one of its pins. It is not part of the display
handover: its probe writes no pin register, each consumer configures only
its own pins, and on the T6040 the USB4 routers' LSTX pins are in the same
bank. A board that enables the routers has to enable it in its device
tree, and the HDMI chain must still be handed over then.

Drop it from the chains and enable the pin controller that the
processor's hdmi-hpd-gpios names, if it is still disabled, in the chain's
changeset. A tree that leaves it off (J614c/J616c, J575c) gets it with the
HDMI chain as before; one that has it on no longer refuses the chain.

The KUnit test tree gets the converter's hotplug GPIO, and a case checks
that an already enabled pin controller does not refuse the HDMI chain.

Reported-by: UlfMoby <[email protected]>
Link: #2243
Signed-off-by: Ryan Murray <[email protected]>
…routers

On the J614s the three USB4 routers (apple,t6040-usb4-acio) never leave
devices_deferred, with "(reason unknown)". Each router has
pinctrl-0 = <&usb4_N_lstx_pins>, and those pins are in the AOP pin
controller (pinctrl@510824000), which t604x.dtsi ships disabled. Only the
display gate enabled it, with the staged HDMI chain, when the boot loader
had handed the HDMI display processor over. Without that,
pinctrl_bind_pins() returns -EPROBE_DEFER for good and records no reason.
The J616s routers bind only because its HDMI chain is handed over.

Enable the pin controller where the J614s and J616s enable the routers,
and say in t604x.dtsi who enables it. The display gate no longer counts
it as part of the HDMI chain, so the chain is still handed over.

Reported-by: UlfMoby <[email protected]>
Link: #2243
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Looks good; approve once the J616s regression row and the J614s row are on this head.

What I checked:

  • staged_enable_hpd_supplier() (drivers/soc/apple/display-gate.c:2452) reads the supplier from the processor's own hdmi-hpd-gpios instead of a fixed path. That's the right source.
  • The last node of all four HDMI arrays is the DCP that carries that property:
    • J616s /dcp@3a2e00000 (t6040-j616s-extdisp.dtsi:30)
    • J614s /dcp@606e00000 (t6040-j614s-extdisp-hdmi.dtsi:69)
    • J614c/J616c (t6041-j616c-hdmi.dtsi:51)
    • J575c (t6041-j575c-hdmi.dtsi:86)
  • USB-C stages have no property there, so they get NULL and change nothing.
  • The supplier goes into the same changeset as the chain, so a refused chain still leaves the pin controller as the DT had it.
  • apple_gpio_pinctrl_probe() (drivers/pinctrl/pinctrl-apple-gpio.c:529-661) only registers descriptors and the gpiochip and writes no pin register, which supports enabling it from the board DT.
  • The branch merges cleanly into the current integration/aurora, which still has /pinctrl@510824000 in all four chains.

The fix rests on two hardware claims that only a boot can show, and neither row has run.

HW row: J616s on this head: HDMI and both USB-C displays handed over, no "already enabled" refusal from the gate, 510824000.pinctrl and the three ACIOs bound, and devices_deferred empty. J614s (reporter or owner) trial boot: devices_deferred empty, three ACIOs bound, the Stage 2 commit check passes, HDMI still comes up. Both with 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

#2446 adds a fifth HDMI chain for the J773s (t6041_lpdptx_hdmi_nodes) that lists /pinctrl@510824000 as a chain node, and both PRs edit staged_ready(), staged_apply() and the J575c USB-C stage in drivers/soc/apple/display-gate.c. Whichever lands second needs a rebase. If this one lands first, the new chain should drop the pin controller and get it through the hdmi-hpd-gpios supplier path added here, provided its dcpext0 node carries that property. This branch merges cleanly into integration/aurora today; the J616s and J614s boot rows are still open.

@e-fu

e-fu commented Dec 1, 2026

Copy link
Copy Markdown

Tested (J614s, MacBook Pro 14" M4 Pro, T6040): both commits cherry-picked unchanged onto stock kernel-aurora 7.3.0-47 (844781f), plus the #2800/#3619 AOP fixes. The -47 config is unchanged, built locally from the kernel-aurora spec. A is the same tree without this PR.

A (without) B (with this PR)
devices_deferred 381ac0000.cio, 389ac0000.cio, 391ac0000.cio empty
ACIOs unbound all three bound to thunderbolt-apple-acio
510824000.pinctrl disabled bound (apple-gpio-pinctrl)
sn201202x "router unavailable" 3× 0
sync_state() pending 12 0
Stage 2 trial – armed by the install, committed by aurora-stage2-commit
  • Two boots on B, same result. USB-C DisplayPort (Dell 4K60 on DP-3) still comes up. 0 SELinux denials, 0 failed units, no new kernel errors vs A (the same 3: DCP firmware memory, typec_displayport -71, SEP).

Not yet: HDMI (no cable here), and an actual USB4/TB device on the routers. The only USB-C device I tested is a DP alt-mode monitor.

@e-fu

e-fu commented Dec 1, 2026 •

Copy link
Copy Markdown

Addendum, same B kernel: USB 3 and DP alt mode still work on all three ports with the ACIOs bound. An iPhone enumerates at 10 Gb/s (SuperSpeed Plus) on 382280000.usb (left rear), 38a280000.usb (left front) and 392280000.usb (right). The Dell 4K60 comes up on the left rear (DP-1, its USB hub enumerates too) and on the right (DP-3). No new kernel errors.

An iPad Pro (M4) on the right port does enter USB4 mode now. The CIO PHY comes up, the 391f00000.nhi child is created, and both sides advertise usb4=1, gen=2, rs_fec=1. Both lanes train into CL0, but 30-110 ms later the router firmware logs SBX disconnected! and Port Group - entering Dead End state. The port then falls back to USB 3 (10 Gb/s), and no USB4 domain is registered. This happened the same way on 5 of 5 plug-ins, with two different Thunderbolt 4 cables. Update: macOS doesn't get a USB4 link to this iPad either. On macOS 27.2.1 (26B131), with two different Thunderbolt 4 cables, all three Thunderbolt/USB4 buses report "No device connected", and the iPad enumerates as a USB device at 10 Gb/s. That is the same end state as on Linux, so this looks like how the iPad behaves as a peripheral, not a Linux bug, and I'm not filing it. Still not tested: a USB4/TB dock or SSD, and HDMI.

This branch has not been deployed

No deployments
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.

J614s (T6040): USB4 ACIO controllers stay in devices_deferred, so the Stage 2 trial commit is refused

2 participants