From cd3ca399657d1e480849010c6802c6479256c716 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sun, 15 Nov 2026 20:43:04 -0500 Subject: [PATCH] tools: apple-dcp: follow #1930's tunnel-watching link wait linux#1930 has dcp_dptx_connect_raw() wait for the link configuration through dcp_dptx_wait_linkcfg(), which on T6050 also ends the wait once the Thunderbolt DP tunnel feeding the port has gone. The lifecycle fixture that pastes the production connect (fast-replug-bounce) did not have the helper, so the unit no longer built. When the pasted connect calls it, the fixture now pastes the production dcp_dptx_wait_linkcfg() and dcp_watches_tunnel_withdrawal() as well. The fixture's machine is the H17P one, which does not watch the tunnel, so the wait is the single wait for the link configuration as before; the tunnel check is a stub that fails the case if it is ever reached. On a tree without #1930 nothing changes. Signed-off-by: Diljit Singh --- .../selftests/drivers/gpu/apple-dcp/lifecycle.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py index 765873741eb40..259e99243ee30 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py @@ -739,6 +739,16 @@ def swap(old, new): ' assert(!"T8132 dcpext teardown in an H17P scenario"); return -ENODEV; }\n') if 'static unsigned long jiffies;' not in unit: firmware += '\nstatic unsigned long jiffies;\n' + if 'dcp_dptx_wait_linkcfg(' in raw: + # The link wait with T6050's tunnel watch. This H17P machine does not watch, so the + # production wait waits for the link configuration once, as before. + firmware += ('#define DCP_LINKCFG_POLL_MS 50\n' + '#ifndef min_t\n#define min_t(t, a, b) ((t)(a) < (t)(b) ? (t)(a) : (t)(b))\n#endif\n' + '#ifndef max_t\n#define max_t(t, a, b) ((t)(a) > (t)(b) ? (t)(a) : (t)(b))\n#endif\n' + 'static bool dcp_tb_tunnel_withdrawn(struct apple_dcp *d, u32 port)\n' + '{ (void)d; (void)port; assert(!"T6050 tunnel watch in an H17P scenario"); return false; }\n' + + apple_function(root, 'dcp_watches_tunnel_withdrawal') + + apple_function(root, 'dcp_dptx_wait_linkcfg')) # unless the update work already needed the clock clock = 'static unsigned jiffies_to_msecs(unsigned long t) { return t; }\n' if clock in unit: