Repository navigation
drm/apple, thunderbolt: apple: stop waiting for a link on a DP tunnel that went - #1930
Merged
DjDeveloperr merged 3 commits intoNov 16, 2026
Conversation
appledrm connects a DP tunnel's display from the DP IN adapter's ordered worker and waits for DCP to configure the link. A tunnel that is taken down meanwhile is detached only after that wait: the detach is queued behind it. The adapter knows at once, when the tunnel is deactivated, that the tunnel is no longer requested. Export apple_dp_tunnel_binding_live() so that appledrm can ask, for the binding it was handed, whether its tunnel is still requested. It takes the adapter's lock, as the binding's set_active callback does. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Isaac-Duarte
marked this pull request as ready for review
November 14, 2026 20:29
A Thunderbolt 5 dock (Ugreen 10-in-1) on a J714s withdraws its first DP tunnel about 190 ms after it is requested, right after DCP starts on it, in about half of its first connects after boot or plug-in, and re-advertises it about 1.4 s later. The connect then waits the full 2 s for a link configuration that cannot come, while DCP retries the link about every 500 ms. The release that follows the timeout can land in the first milliseconds of such a retry, and then DCP never answers it: apple-dcp 2b2e00000.dcp: dcp_dptx_connect: timed out waiting for port 0 link configuration apple-dcp 2b2e00000.dcp: AFK[ep:2c]: AppleDCPDPTXRemotePort (chan:1) service call group 0 cmd 7 failed to complete: -110 thunderbolt-apple-acio 381ac0000.acio: dpin0: display teardown failed: -110 thunderbolt-apple-acio 381ac0000.acio: dpin0: DP tunnel setup failed: -110 The display stays dark, its pipeline held, until the dock is plugged in again. Over 11 such connects, 4 of the 5 releases sent within 26 ms of a retry went unanswered, and none of the 6 sent 97 ms or more after one. Wait for the link in 50 ms slices, and ask the Thunderbolt glue between them whether the tunnel feeding the port is still requested. Once it is not, release the display at once, well before DCP's first retry. This makes an unanswered release rare, not impossible: DCP can still leave an early release unanswered, and then the re-advertised tunnel's connect recovers the display. Only T6050 watches the tunnel for now; elsewhere the wait is unchanged until it is tested there. Tested on J714s with the dock on the right port: over 8 boots the dock withdrew the first tunnel each time, the wait ended 17 to 48 ms later, and all three displays came up on the re-advertised tunnels, with no timeout and no -110. Over a later day of use (8 boots, 33 withdrawals of DP IN 0, 1 and 2), one early release still timed out: DP IN 2's tunnel went at 13:02:16.596, DCP retried at 17.066, the release failed with -110 at 17.658, and the re-route at 19.570 brought the display up. No display stayed dark. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
Isaac-Duarte
force-pushed
the
t6050-dp-tunnel-withdrawn
branch
from
November 15, 2026 20:35
28e0e17 to
56793ef
Compare
dcp_dptx_connect_raw() now waits through dcp_dptx_wait_linkcfg(), so the bounce scenario pastes it too. The scenario is an H17P link: the tunnel-withdrawal watch is off and reaching it is a failure. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
DjDeveloperr
merged commit Nov 16, 2026
bfc90e9
into
aurora-silicon:integration/aurora
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a J714s (M5 Pro), a Thunderbolt 5 dock's first DP tunnel after boot or plug-in sometimes leaves its display dark until the dock is plugged in again:
What happens
With
thunderbolt.dyndbg=+p thunderbolt_apple.dyndbg=+p, times from the tunnel's paths being set up:display routed to Thunderbolt DP tunnel dpin0), before DPRX is donedpin0: activedpin0: interrupt … HPD 0, HPD changedacking hot unplug event on 1:12,DP OUT resource unavailable: adapter unplug: the dock withdraws its DP OUT and the tunnel is deactivatedacking hot plug event on 1:12: the dock re-advertises itOn boots where the dock does not withdraw, DPRX completes at about +160 ms and the display comes up. Where it does, the connect still waits the full 2 s for a link configuration on a tunnel that is gone: it runs from the DP IN adapter's ordered worker under the fabric lock, so the detach that would end it is queued behind it. Meanwhile DCP retries the link about every 505 ms (
DPTXPort: firmware reports link fault 22).When the 2 s run out,
out_withdrawreleases the display (group 0 cmd 7). If that release lands in the first few milliseconds of one of DCP's retries, DCP never answers it, and every later DPTX call times out too; the pipeline stays held. Over 11 such connects in the journal:link fault 22A longer settle before DCP starts does not help: with 400 ms instead of 100 ms (
apple_dpin_m5.settle_ms), the dock withdrew 50 ms after DCP started, at +471 ms. The withdrawal follows DCP's start, not the tunnel's.What changes
1. thunderbolt: apple: tell appledrm whether a DP tunnel is still requested
apple_dp_tunnel_binding_live(binding), declared indp-tunnel.hand found withsymbol_get()like the other hooks there. It is true while the binding's tunnel is requested (apple_dpin_token_access()) and the adapter is alive. Deactivation clears both at once, before the detach reaches appledrm.set_activecallback does, so the lock order (appledrmtb_lock, then the adapter's lock) is unchanged.2. drm/apple: stop waiting for a link on a DP tunnel that went
dcp_dptx_connect_raw()waits for the link configuration in 50 ms slices (dcp_dptx_wait_linkcfg()), and between them asks whether the tunnel feeding the port is still requested (dcp_tb_tunnel_withdrawn()): port 0's binding, or on port 1 the tiled split's own binding. Once it is not, it logsthe DP tunnel went before link configurationand withdraws at once, through the existingout_withdrawpath.of_machine_is_compatible("apple,t6050")) watches the tunnel. M2 Pro/Max, T6030 and every other SoC keep the single 2 s wait until this is tested there. Direct DP alt mode connects have no binding and wait as before; compact (T8132) and late-HPD (T8122) connects keep their single wait.Testing
J714s (MacBook Pro 14" M5 Pro), kernel 7.3.0-36.n1usb (integration/aurora 9219565) with #1921 and this series,
appledrm.koandthunderbolt_apple.kobuilt from that tree. Dock: Ugreen 10-in-1 Thunderbolt 5 on the right port, three 1920x1080@165 displays.Before this series, on the same setup: 11 of 21 first connects hit the withdrawal; 4 of those stayed dark.
A day of use afterwards (2026-11-15: 12 boots of a kernel carrying this series, 8 of them with dock connects and withdrawals; those boots ran the previous revision of commit 2, which behaves identically on T6050's DPTX port 0: the gate is true there and the binding is the same): 33 withdrawals (24 of DP IN 0, 5 of DP IN 1, 4 of DP IN 2), each followed by a re-route and the display coming up. One early release still timed out, on DP IN 2 (dcpext2,
302e00000.dcp):display routed to Thunderbolt DP tunnel dpin2dcp_dptx_connect: port 0: the DP tunnel went before link configurationlink fault 22)group 0 cmd 7 failed to complete: -110dpin2; the display came upSo DCP can leave even an early release unanswered; the series makes it rare (1 of 33 releases unanswered and none dark, against 4 of 11 unanswered and dark before) and the re-route recovered it. No display stayed dark.
drivers/thunderboltordrivers/gpu/drm/apple. The revised commit 2 (T6050 gate, per-port binding, helpers moved abovedcp_dptx_connect_raw()'s comment):dcp.obuilds withLLVM=1 W=1and no compiler warnings.dcp.candthunderbolt/apple.c, which the fabric and DP IN suites do not exercise.Not tested
dcp_typec_port_untileable()treats firmware-27 pipelines as unable to take a tile.)Related: #1921 (third dock display). Independent of it; tested on top of it.