Skip to content

thunderbolt: hold a shared-rate DP re-link while its display reads the DPRX - #3269

Open
erikwb wants to merge 4 commits into
mainfrom
fix/thunderbolt-dp-relink-dprx
Open

erikwb wants to merge 4 commits into
mainfrom
fix/thunderbolt-dp-relink-dprx

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: On hosts whose two DP IN streams share one link rate (TB_HOST_DP_SHARED_RATE), a dock that reports its displays one at a time (a CalDigit TS5 with two monitors) had its first tunnel re-linked from HBR3 to HBR2 under the display's Activate. DCP's Activate was refused (-ESTALE) and the displays stayed dark after a replug. The re-link now waits until no display reads the tunnel's DPRX. A tunnel whose DPRX read times out is kept and re-linked on its own DP IN. No tunnel the re-link sets up or tears down, the second display's included, is made during a system sleep transition. A refused call on a stale DP IN binding now logs why.
Tested: J713 (M4 Air, T8132, firmware 27.2) docked on a CalDigit TS5 (boltctl authorized, 40 Gb/s, 2 lanes) with two 3840x2160 monitors on DP-1 and DP-3, at head 3b32d06f7ae5 in a trial kernel built from main 9867e173efb8 plus the J713 external-display PRs #2673 (fd3dc16c121b) and #3273 (7f21093a0d31, stacked on #2673) and this head (#2673 is open and conflicts with current main, and #3273 stacks on #2673, so they were merged onto the main #2673 branched from), default command line, one-shot GRUB boot with the slot's Stage 2 and device tree. Cold boot docked: eDP-1 2560x1664@60 and DP-1 and DP-3 3840x2160@60 up, 0 failed units, 0 AppArmor denials, 0 Oops/BUG/WARNING/SError/DART faults. The first display's tunnel came up at 8100 Mb/s per lane and was held (another DP tunnel is wanted: re-linking once its display has read its DPRX), then re-linked to 5400 Mb/s per lane (HBR2) with the two displays routed to their own DP INs (dpin0, dpin1) and no refused-call line. 3 DPMS off/on cycles brought all three outputs off and back at the same modes each time. 3 s2idle suspend/resume cycles (rtcwake -m freeze -s 5) with the TS5 still authorized brought all three back at the same modes each time, with no thunderbolt or DP tunnel error line. The kernel err lines at boot match a docked boot of the J713's default kernel (a daily that carries these PRs; 0 new). J313 (M1 Air, T8103, non-shared-rate Apple USB4 host apple_dpin_m1) at head 3b32d06f7ae5 in a composite trial kernel (origin/main 429e7e15f122 + #3335, #3506, #3508, #3269, #3359, #3289; 12/12 drivers/thunderbolt/* .o/.text byte-identical vs single-PR merge on 429e7e15f122, default command line, docked CalDigit TS5 + DP-2 3840x2160@120): TS5 authorized at boot, 0 thunderbolt/tunnel/usb4 error lines, 5 external DPMS off/on cycles clean (each external DPMS cycle logs one DCPDP2XService admission failed: -19 line + IOMFB syslog noise, not yet compared with the default kernel), 1x deep S2R (rtcwake -d rtc1 -m mem -s 30, ext display DPMS off first: success=1), 0 failed units, 0 AVC denials, 5 err+ lines matching default boot. KUnit (120: 119 pass, 1 skip) and the added 38-case re-link replay (with its 29 negative controls) pass at the head; the full host suite ran 695/696, matching main's 694/695 baseline plus the added replay with only the same pre-existing apple-dcp failure (15 not ok) (Evidence). The pre-review form of this fix, in a J713 M4 Air test kernel on 27.2 firmware, brought up both monitors of a CalDigit TS5 and brought them back after an unplug and replug.
Risk: two-way door · M4 (T8132: J713/J715 Air, J604 14" Pro, J773g mini) and M4 Pro/Max (T6040/T6041), the hosts with TB_HOST_DP_SHARED_RATE; the refused-call log line on every Apple host with DP IN display handoff.
Not yet: the J713 dock rows that need someone at the Mac: unplug and replug of the dock or of one monitor (the HBR3-to-HBR2 re-link above happened on the cold boot with the dock attached, not on a replug), and the same on 26.6.2 firmware on main plus this PR; the dock rows on main itself (the J713 display PRs are open and not yet merged: #2673 currently conflicts with main, while #3273 is mergeable against its stacked base j713-dcpext/air-dcpext-272); J313 s2idle and physical dock/monitor replug (remote test, no physical replug possible); a dock row on an M4 Pro/Max (J616s, T6040/T6041) and a second Apple USB4 host (J316s or J414c) as requested in review (J616s, J316s, and J414c are not available in this lab).

Details

The problem. A dock that reports its displays one at a time gets its first DP tunnel at HBR3. The second display then has that tunnel re-linked at HBR2 while DCP is still waking its DP IN. The re-link replaces the DP IN request DCP was handed, so DCP's Activate is refused (-ESTALE) and the link never comes up. After a dock replug, the dock's displays stay dark.

The change, in short.

  • The re-link is held while a display may be reading the tunnel's DPRX, and made once the read is done, times out or is given up, or once the host waits for a display pipeline for the tunnel with no handoff attempt in flight (that tunnel is retired atomically and re-linked at once; a pipeline retry in flight keeps its DPRX deadline renewed as before).
  • Whether the re-link is still wanted comes from the tunnels and adapters, so a hold that turns into a sleep deferral or a queued pass is not lost.
  • If the DPRX read times out meanwhile, the tunnel is kept and re-linked through the same pairing and re-link work as any other, on its own DP IN first, once the domain queue has let it go. That wanted re-link comes before the HBR2 fallback of a tunnel re-linked up to HBR3, so both displays keep their DP IN adapters. A tunnel re-linked up that does not come up is kept the same way and set up at HBR2 again on its own DP IN.
  • Every one of those re-links goes through tb_dp_relink_enter(), which admits it only while no system sleep transition is in progress and holds that admission through its last setup. The last setup includes the other display's tunnel that a re-link down made room for. During a transition nothing is torn down or set up; the work stays recorded and is done once the transition is over. That includes the HBR2 cap a failed HBR2 fallback leaves, so the display is then set up at HBR2, not at the rate that just failed.
  • A hold that ends while hotplug is frozen for system sleep is replayed at thaw or resume.

Commits

  1. thunderbolt: apple: let a DP re-link retire a tunnel awaiting a pipeline

    • apple_dpin_retirable(): the request waits for a display pipeline (apple_dpin_awaits_display()) and no attempt to hand it to a display is admitted (none in flight, none handed). A request that is no longer the current one has nothing left to hand.
    • dp_tunnel_awaits_display() is unchanged. It still reports a tunnel as waiting while a pipeline retry attempt runs, so the DPRX deadline is renewed until the attempt reaches the display driver.
    • New NHI hook dp_tunnel_retirable(): the read-only apple_dpin_retirable() for the tunnel of a given generation. It is a hint for when to decide a held re-link again.
    • New NHI hook dp_tunnel_retire_waiting(): retires the request of the tunnel with the given generation unless an attempt is admitted. It runs under the DP IN lock that admits attempts. A retired request admits no further attempt, so a retry due for it starts none.
  2. thunderbolt: hold a shared-rate DP re-link while its display reads the DPRX

    • tb_dp_tunnel_release_display(): a tunnel whose DPRX read is not under way may be torn down. While the read is under way, the tunnel is let go only when the host still waits for a display pipeline for it. Its handoff is then retired through dp_tunnel_retire_waiting(), and the tunnel is torn down without being announced down again.

    • tb_dp_relink_settle() turns a TB_DP_RELINK_NOW into the new TB_DP_RELINK_HOLD when the tunnel is not released.

      • Pairing (tb_dp_host_rate_limit()) leaves the host DP IN adapters alone on HOLD, as it already does for WAIT during system sleep, and logs the hold once.
      • The re-link to a higher rate (tb_dp_host_relink_up()) is held the same way.
    • tb_dp_relink_unhold() wakes a held re-link:

      • from tb_dp_tunnel_active(), when the tunnel's DPRX read is done, timed out or given up;
      • from the DPRX work's new await_callback, on a pass that finds the host waiting for a display pipeline with no handoff attempt admitted (tb_dp_tunnel_retirable()).
    • While a pipeline retry attempt runs, the DPRX work renews the deadline as before and wakes nothing.

    • Pending transition. tb_dp_relink_wanted() decides whether a re-link is still wanted from the CM's own state, as pairing and the re-link work decide it, not from the hold flags:

      • to HBR2: a host DP tunnel above HBR2 while another host pair is free (tb_dp_relink_down());
      • to the higher rate: the lone tunnel's host_relink mark with its debounce over (tb_dp_relink_up()).

      It therefore survives a pass that defers the re-link for system sleep (TB_DP_RELINK_WAIT) instead of holding it, and a pass queued for thaw.

    • DPRX timeout of such a tunnel. The tunnel is kept, listed (host_relink_kept), instead of torn down with its DP IN dropped. A tunnel re-linked up (host_relinked_up) that did not come up is kept the same way, for its HBR2 fallback. No separate recovery path or saved state is used. Instead, the existing entry points make the re-link:

      • Pairing makes the re-link to HBR2 through tb_dp_host_relink(): the same pair first, then the other display, with the same backoff bookkeeping.
      • The re-link work makes the re-link up through tb_dp_host_relink_up(): an immediate HBR2 fallback on the same pair if HBR3 cannot be set up, dp_relinked_at for the debounce, and host_relinked_up for the DPRX-timeout fallback.
    • Precedence. A wanted re-link is checked before the HBR2 fallback of a tunnel re-linked up that did not come up. Suppose a second display arrives while that tunnel reads its DPRX at HBR3, and the read times out. The tunnel is kept and re-linked down on its own pair, and the other display is paired after it. Otherwise the fallback would drop the tunnel and pair both displays afresh, possibly on swapped DP IN adapters.

    • Release. Until it is released, the DPRX work may still hold the kept tunnel and its HopIDs. Every pass holds its re-link until then (tb_dp_relink_settle_tunnel()), including an inline pass such as tb_complete()'s. Release comes from tb_dp_relink_kept(), called from the pairing work and the re-link work. Both run on the ordered domain queue, behind the DPRX work.

    • Re-link no longer wanted. Suppose the other display went, or another came. A released kept tunnel is then handled as a DPRX timeout (tb_dp_tunnel_inactive()): after a re-link up, set up at HBR2 again, once, between the same adapters (tb_dp_host_relink(); if that fails, pairing tries again at HBR2 at most); otherwise torn down with its DP IN dropped.

    • System sleep admission: one way in. tb_dp_relink_enter() / tb_dp_relink_exit() wrap tb_dp_relink_admit(): true only while no system sleep transition is in progress, and the admission (a read hold on the PM gate) is kept until exit, so no transition starts in between. Every tunnel the re-link machinery tears down or sets up is torn down or set up only inside it; tb_dp_host_relink() refuses (WARN_ON) to run outside it. When the gate is closed, nothing is torn down or set up, the work stays recorded where it is, and the re-link work, armed there, waits for the transition to end and does it from the domain queue; thaw, resume and complete arm it again (tb_dp_relink_replay()). The rule and the paths are written at the function.

    • The pass after a re-link. A re-link down marks the pairing that follows it as part of it (dp_relink_pairing), whether it set the tunnel up again or not, as a failed re-link or a kept tunnel's teardown already did. That pass is entered in tb_dp_host_rate_limit(), which hands the admission to tb_tunnel_dp() (relinking) to hold through its last setup: the other display's tunnel after a re-link down, or the tunnel that could not be set up again. The admission is released between the re-link and that pass, so a transition can start there. The pass then sets nothing up and stays marked for the re-link work. The HBR2 cap (dp_host_hold_shared) is used only by a pass that goes on to pair, so a cap left by a failed HBR2 fallback still applies when the pass runs after the transition.

      Path Sets up or tears down a tunnel Gated how Recorded while closed
      Re-link to HBR2 (tb_dp_host_rate_limit() → tb_dp_host_relink()) yes entered; closed → WAIT, host DP IN adapters wait dp_relink_deferred, dp_tunnel_pending, the HBR2 cap
      Re-link up (tb_dp_host_relink_up() → tb_dp_host_relink()) yes entered; closed → WAIT, re-armed the tunnel's host_relink mark
      Kept tunnel, re-link still wanted (tb_dp_relink_kept()) no: left to the two rows above — the kept tunnel
      Kept tunnel, re-link not wanted: HBR2 fallback or teardown (tb_dp_relink_kept() → tb_dp_tunnel_inactive()) yes entered; closed → stays kept, listed with its adapters the kept tunnel
      Pairing pass after a re-link down (the other display's tunnel), a failed re-link or a kept tunnel's teardown (tb_dp_host_rate_limit() → tb_tunnel_dp(), dp_relink_pairing) yes entered in tb_dp_host_rate_limit(), held through tb_tunnel_dp()'s last setup; closed → host DP IN adapters wait dp_relink_pairing, the HBR2 cap (dp_host_hold_shared)
      DPRX completion (tb_dp_tunnel_active()) keeps the tunnel (re-link wanted, or re-linked up) or, otherwise, tears it down as on main; sets nothing up — —
      Hold wakeups: tb_dp_relink_unhold(), the await callback, tb_dp_relink_pair_again(), tb_dp_relink_replay() no: queue or arm only through the rows above —
      Thaw, resume, complete, runtime resume, CIO sleep restore run pairing and the re-link work through the rows above —
      Unplug (tb_dp_resource_unavailable(), tb_dp_host_tunnel_gone()) tears down the unplugged tunnel; marks only as on main —
      Pairing of a display outside the machinery yes as on main, which does not gate it during a transition —
    • A kept tunnel is an ordinary listed tunnel. An unplug, a router removal or a suspend that releases DP takes it down, so no stale endpoint identity is left.

    • Pairing requests from the hold, wakeup and timeout paths are recorded before the hotplug check, so thaw, resume or complete replays them. A stopping domain records nothing.

    • The tb_tunnel_dp() debug line for a waiting host DP IN now says waiting for a DP tunnel re-link, because it covers both cases.

  3. thunderbolt: apple: say why a call on a stale DP IN binding was refused: a refused Activate logs at info level whether the binding's tunnel was retired, replaced or has no admitted attempt. The line carries the binding's generation and the requested and admitted ones. A refused Deactivate after the tunnel went happens on every unplug, so it is logged at debug level.

  4. tools/asahi: replay a shared-rate DP re-link over a display's Activate: a host replay that compiles these from the tree:

    • the connection manager's pairing, re-link, admission and DPRX completion code;
    • the DPRX work;
    • the Apple glue's DP IN request, binding and display hooks.

    Its PM gate mock counts readers and can close the moment the last one leaves, as the PM notifier does. It replays 38 dock cases through the real DPRX work and callback, with 29 negative controls. It is registered with run-host-tests.py.

Hosts affected.

  • TB_HOST_DP_SHARED_RATE is set only in apple_dpin_m4, which T8132 and T6040/T6041 use.
  • Elsewhere none of these are reached or have any effect: tb_dp_relink_settle(), tb_dp_tunnel_release_display(), tb_dp_relink_wanted(), tb_dp_relink_enter(), dp_relink_pairing and kept tunnels (tb_dp_relink_kept() finds none). No hold is ever set, so tb_dp_relink_unhold() and the await callback do nothing.
  • dp_tunnel_retirable() and dp_tunnel_retire_waiting() are registered with dp_tunnel_awaits_display() on every host whose policy retries for a pipeline, but only the shared-rate paths call them.
  • dp_tunnel_awaits_display() and the DPRX deadline are unchanged on every host.
  • tb_dp_host_rate_limit() returns 0 at once without the policy, with relinking clear, and dp_host_hold_shared is set only under it.
  • tb_dp_tunnel_inactive() is main's DPRX-timeout handling moved into a helper. On a host without the shared-rate policy only its teardown branch is reached, as on main. Its HBR2 fallback branch (host_relinked_up, set only under the policy) now runs from the kept tunnel, on the same pair, once admitted.

Related. The display side of the same dock replug, on a firmware-27.2 T8132 dcpext, is a separate drm/apple PR, #3273 (stacked on #2673). Neither PR needs the other to build or to pass its tests. Both are needed for a two-monitor dock to light reliably across a replug on the M4 Air with 27.2 firmware.

Evidence
  • Base main b45f9e7. Head 3b32d06f7ae5: 6709dd3, 0df2a3f, 2e8eb2d, 3b32d06.

  • KUnit, qemu arm64 (kunit.py run --arch=arm64 --make_options LLVM=1 with USB4_KUNIT_TEST, USB4_APPLE_SOC and USB4_APPLE_DPIN_KUNIT_TEST), at the head: 120 tests: 119 passed, 1 skipped (apple_g17_rx_util_min_test, which needs CONFIG_UCLAMP_TASK). thunderbolt includes the new tb_test_dp_shared_rate_settle, _dprx_hold, _hold_pipeline_wait, _hold_retry_admitted, _hold_handoff and _hold_frozen; apple-dpin-lifecycle includes the new apple_dpin_m4_retire_waiting. The tests that call tb_dp_host_rate_limit() also check that it leaves no admission held.

  • KUnit negative controls, rerun at the head, one fix taken out at a time; each fails its test:

    • DPRX work without the await callback: tb_test_dp_shared_rate_hold_pipeline_wait (and _hold_retry_admitted) fail.
    • The await callback waking the hold while a retry attempt is admitted: tb_test_dp_shared_rate_hold_retry_admitted fails.
    • No pairing request recorded while hotplug is stopped: tb_test_dp_shared_rate_hold_frozen fails.
    • apple_dpin_retirable() ignoring an admitted attempt: apple_dpin_m4_retire_waiting fails.
  • tools/asahi/tb-dp-relink-hold-tests.py: 38/38 cases, with the default cc (GCC) and with CC=clang. Each of the 29 negative controls fails at least one case with a CHECK (exit 77), with the same cases under both compilers:

    Negative control Cases that fail
    settle returns NOW 30 of 38
    no wakeup at DPRX completion 21
    hold kept after the DPRX read 22
    the host never releases a waiting tunnel pipeline-wait, relink-up-pipeline-wait, retire-before-retry, retry-in-flight-refused
    no reconsideration in the pipeline wait pipeline-wait, relink-up-pipeline-wait, retry-in-flight-refused
    retire with an attempt admitted retry-in-flight-handed, retry-in-flight-refused
    admitted retry not counted as waiting (its DPRX deadline runs) retry-stalled-m1, -m3, -m4 (tunnel and DP IN gone), -m5 (active before DPRX)
    DPRX work wakes the hold while an attempt runs retry-in-flight-handed, retry-in-flight-refused
    decide on the wait and retire at teardown retire-before-retry, retry-in-flight-handed, retry-in-flight-refused
    timeout tears the tunnel down and drops its DP IN 13 timeout cases
    a re-link up's HBR2 fallback ahead of the wanted re-link down replug-under-relink-up, -sleep-gate
    no pairing request recorded while frozen frozen-then-thaw, queued-timeout, relink-up-replaced, replug-under-relink-up-gone, teardown-pairing-gate
    pairing request recorded while stopping stopping
    timeout keeps the tunnel only while the hold flag is set 13 timeout cases, including sleep-gate-timeout and queued-timeout
    timeout does not keep a tunnel due for its re-link up the 6 relink-up-* timeout cases
    a kept tunnel not held before its release complete-in-window
    a kept tunnel released by any pass, inline ones too complete-in-window
    a kept tunnel never handled once its re-link is not wanted 9 cases, including fallback-sleep-gate, fallback-retry and teardown-pairing-gate
    a kept tunnel re-linked up dropped, without the HBR2 fallback fallback-sleep-gate, fallback-retry, -gate, relink-up-timeout-fallback, the three replug-under-relink-up-gone* cases
    the HBR2 fallback torn down and paired afresh, as before (not on the same pair) fallback-sleep-gate, fallback-retry, -gate, the three replug-under-relink-up-gone* cases
    admission point admits whatever the PM state sleep-gate-timeout, sleep-gate-timeout-second-gone, replug-under-relink-up-sleep-gate, replug-under-relink-up-gone-sleep-gate, -thaw-gate, fallback-sleep-gate, teardown-pairing-gate, retry-pass-gate, relink-up-gate-race, relink-down-pairing-gate, fallback-retry-gate
    the re-link to HBR2 goes around it sleep-gate-timeout, sleep-gate-timeout-second-gone, replug-under-relink-up-sleep-gate, replug-under-relink-up-gone-sleep-gate
    the re-link up goes around it relink-up-gate-race
    a kept tunnel's fallback or teardown goes around it fallback-sleep-gate, replug-under-relink-up-gone-sleep-gate, -thaw-gate, sleep-gate-timeout-second-gone
    the pass after a re-link goes around it retry-pass-gate, teardown-pairing-gate, relink-down-pairing-gate, fallback-retry-gate
    that pass not marked after a failed setup (tb_dp_host_relink()) fallback-retry-gate (a failed re-link down is also marked by the re-link down itself)
    that pass not marked after a kept tunnel's teardown teardown-pairing-gate
    that pass not marked after a re-link down relink-down-pairing-gate
    the HBR2 cap used up by a pass the gate keeps from pairing fallback-retry-gate
  • System sleep admission, each path with the PM gate closed (none sets up a tunnel generation until the gate reopens; then the work is done):

    • relink-down-pairing-gate: the first display up at HBR3, its DPRX read done; the second display comes and the re-link down succeeds on the same pair; the gate closes the moment that re-link releases the admission. Only the first display's replacement is set up. The second display's tunnel waits for the gate to reopen, and then both run at HBR2, each on its DP IN.
    • fallback-retry-gate: a tunnel re-linked up to HBR3 times out alone; its HBR2 fallback on the same pair fails setup once; the gate closes the moment the fallback releases the admission. The pass that pairs the display again sets nothing up until the gate reopens, and then sets it up at HBR2 (5400 Mb/s per lane, limit 5400), with the cap and the pass mark cleared, and the display brings it to ACTIVE. fallback-retry is the same with the gate open: HBR2 at once.
    • replug-under-relink-up-gone-sleep-gate: a tunnel re-linked up to HBR3, the second display back while it reads its DPRX, the gate closed, the read timed out, then the second display unplugged with hotplug on. -thaw-gate: the same with the timeout while hotplug is frozen and thaw before the gate reopens. Once the gate reopens the tunnel is set up at HBR2 on its own pair and its display brings it to ACTIVE.
    • fallback-sleep-gate: a lone tunnel re-linked up to HBR3 times out with the gate closed (the HBR2 fallback as on main, now only once admitted, on the same pair).
    • sleep-gate-timeout-second-gone: a kept tunnel's teardown waits for the gate; then its display is paired on the other DP IN.
    • teardown-pairing-gate, retry-pass-gate: the gate closes the moment a kept tunnel's teardown, or a re-link whose setup failed, releases the admission; the pass that pairs again sets nothing up until it reopens.
    • relink-up-gate-race: the gate closes after the re-link work's own gate check, before the re-link up.
    • Also, as before: sleep-gate-timeout, relink-up-sleep-gate, replug-under-relink-up-sleep-gate.
  • The replay at the head against the drivers/thunderbolt/ tree of the previous head 39f4983dfceb (production build, no mutations): 36/38. relink-down-pairing-gate fails because the second display's tunnel was set up while the gate was closed: the next generation was 4, against 3 for the first display's replacement alone. fallback-retry-gate fails because, after the gate reopened, the display was set up at the HBR3 rate that had just failed. fallback-retry (gate open) passes on both.

  • Earlier rounds' cases, all still in the replay, each failed its behavioural check against the revision it fixed: replug-under-relink-up-gone-sleep-gate and -thaw-gate (a new tunnel generation while the gate is closed), fallback-sleep-gate and sleep-gate-timeout-second-gone (torn down with the gate closed), teardown-pairing-gate and retry-pass-gate (a tunnel set up with the gate closed), replug-under-relink-up-gone (the fallback not on the same pair); sleep-gate-timeout and relink-up-sleep-gate (a tunnel set up again with the PM gate closed); complete-in-window and relink-up-complete-in-window (an inline pass sets up a tunnel while the old paths still hold the HopIDs); relink-up-setup-fails (no HBR2 fallback on the same pair); relink-up-timeout (the debounce not doubled); timeout-keeps-pair (the displays swap DP IN adapters); relink-up-replaced (a replacement router inherits the re-link up); replug-under-relink-up (DP IN 5 → DP OUT 14, DP IN 6 → DP OUT 13) and -sleep-gate (new generations before the gate reopens).

  • tools/asahi/run-host-tests.py, full suite, both run on the same day: 695/696 at the head, against 694/695 on main b45f9e7. The extra run is the new replay. The one failure is apple-dcp on both, with the same 15 tests not ok. tb-dp-repair-tests (which compiles tb_dp_tunnel_active() and tb_dp_tunnel_inactive()) passes, and its mutants are caught.

  • checkpatch.pl --strict, per commit: 0 errors, 0 warnings, 0 checks on the three thunderbolt commits. The replay commit gets only the usual new-file MAINTAINERS warning. git diff --check clean. Each commit builds on its own (drivers/thunderbolt/ at commit 2 alone with W=1, and the full J713 kernel at the head), with no compiler warnings.

  • Hardware, J713 (M4 Air, T8132, firmware 27.2), docked on a CalDigit TS5 with DP-1 and DP-3 monitors: trial kernel from main 9867e173efb8 + drm/apple, soc: apple: external displays on the M4 MacBook Air (J713) over USB-C on macOS 27.2 #2673 fd3dc16c121b + drm/apple: drive a two-display dock from the firmware-27.2 T8132 dcpexts #3273 7f21093a0d31 + thunderbolt: hold a shared-rate DP re-link while its display reads the DPRX #3269 3b32d06f7ae5 (clean build with Clang/LLVM, the running kernel's configuration with CONFIG_DRM_ASAHI=m, thunderbolt and thunderbolt_apple loaded, the trial kernel's own device trees not installed, so the slot's Stage 2 device tree was used), sha256 of the Image b26a02a66bdb, default command line, one-shot GRUB entry (next_entry cleared by the boot, the default kernel and default Stage 2 sha256 the same before and after).

    • boltctl: TS5 authorized, 40 Gb/s = 2 lanes * 20 Gb/s rx and tx. DP-1, DP-3, eDP-1 connected and enabled. Hyprland: eDP-1 2560x1664@60 (scale 2), DP-1 3840x2160@60, DP-3 3840x2160@60.
    • dmesg: apple-dcp 286e00000.dcp: display routed to Thunderbolt DP tunnel dpin0; thunderbolt-apple-nhi 401f00000.nhi: 0:5 <-> 1:11 (DP): another DP tunnel is wanted: re-linking once its display has read its DPRX; then ... re-linking at up to 5400 Mb/s per lane (was 8100); then both apple-dcp 286e00000.dcp and apple-dcp 48ae00000.dcp display routed to Thunderbolt DP tunnel dpin0 and dpin1. No stale, refused or -ESTALE line, and no thunderbolt or DP error line, for the whole boot, including the 3 s2idle cycles.
    • 3 DPMS off/on cycles (hyprctl DPMS action off, 6 s, on, 10 s): each time eDP-1, DP-1 and DP-3 dpms Off and enabled disabled, then dpms On and enabled at the same modes, with boltctl authorized throughout. Each on re-ran set_digital_out_mode for the two external DCPs and dcp_hotplug() connected:1 valid_mode:1 with no error.
    • 3 s2idle cycles (rtcwake -d /dev/rtc1 -m freeze -s 5; PM: suspend entry (s2idle) and PM: suspend exit each time, about 2 s asleep): dcp_poweroff() and dcp_dptx_disconnect() on both external DCPs at suspend, dcp_poweron(), set_digital_out_mode 3840x2160 and dcp_hotplug() connected:1 valid_mode:1 at resume, all three outputs connected, enabled at the same modes, boltctl authorized every time. No DP link rate change was logged across the suspends (the tunnel stayed at 5400 Mb/s per lane).
    • A connector-level reprobe (echo off then echo detect to card1-DP-3/status and card1-DP-1/status) only flipped the sysfs status: no dmesg activity and Hyprland did not change, so it is not counted as a re-link exercise.
    • Result: systemctl --failed empty, 0 AppArmor denials, 0 Oops/BUG/SError/WARNING/DART-fault/GPU-fault/call-trace lines, 0 thunderbolt or DP tunnel err lines. The kernel err lines are apple-dcp 30ae00000.dcp failed to extract init props: -2 and unsupported DFB layout 2560x1664, two apple-pmgr-pwrstate ... PS 0x3a0 reset lines, DCPDP2XService admission failed: -19 (two at boot, plus two after each DPMS on and each s2idle resume), the of_irq_parse_pci lines for the dock's bridge and Ethernet, the apple_sep matching line, and dwc3-apple 402280000.usb: PM: device_prepare(): genpd_prepare returns -11 at each suspend entry; all of these are also logged by the J713's default kernel docked (0 new).
    • Before this docked run, the same head in fleet candidate 90de523e9ed9 (main fcb124279183 plus the unchanged heads of ASoC: apple: enable J716c (16-inch M5 Max) AOP audio, v2-only speakers, jack and mic array #3085, pwm: apple: runtime suspend on zero duty cycle #3219, thunderbolt: hold a shared-rate DP re-link while its display reads the DPRX #3269, drm/apple: pause and settle presentation during firmware-27 paired stop #3305, arm64: dts: apple: t6050: allow idle ps_isp_sys domain to power off #3329 and serial: apple-dockchannel: stop idle console drain timer, back off RX, and add sleep PM #3335), default command line + panic=10, with the TS5 disconnected: clean boot, 0 failed units, 0 AppArmor denials, thunderbolt / thunderbolt_apple loaded with no error; all 6 kernel err lines and the J713 deep-sleep reset reproduce on plain main fcb124279183. The PR merges into current main with no conflicts.
  • Re-verified at 3b32d06f7ae5 (2026-12-01): git merge-tree --write-tree against main a171afd2123f is clean (0 conflicts); KUnit drivers/thunderbolt/.kunitconfig.apple-dpin (arm64, LLVM=1): 120 tests (119 passed, 1 skipped); tools/asahi/tb-dp-relink-hold-tests.py (cc and CC=clang): 38/38 cases and 29/29 negative controls; tools/asahi/tb-dp-repair-tests.py --mutations: 16/16 cases and 16/16 mutants; tb-cio-sleep-tests.py, tb-dock-pm-tests.py, tunnel-route-tests.py, tbnet-refill-tests.py, and t8132-usb4-policy-tests.py pass; full arm64 LLVM=1 linux-j313 kernel/modules/dtb build passes.

  • Hardware, J313 (M1 Air, T8103, non-shared-rate Apple USB4 host apple_dpin_m1) at 3b32d06f7ae5 in a composite trial kernel (origin/main 429e7e15f122 + #3335, #3506, #3508, #3269 3b32d06f7ae5, #3359, #3289; 12/12 drivers/thunderbolt/* .o/.text byte-identical vs single-PR merge on 429e7e15f122, GRUB one-shot, default command line, docked CalDigit TS5 + DP-2 3840x2160@120, AC 100%):

    • Cold boot docked: TS5 authorized at boot, 0 thunderbolt/tunnel/usb4 error lines, 0 failed units, 0 AVC denials, 5 err+ lines matching default boot.
    • External DP-2 DPMS off/on x5: clean (0 thunderbolt/tunnel/usb4 errors; each external DPMS cycle logs one DCPDP2XService admission failed: -19 line + IOMFB syslog noise, not yet compared with the default kernel).
    • Deep S2R mux: apple-display-crossbar: replace the T602x selector fields instead of OR-ing them #1 (rtcwake -d rtc1 -m mem -s 30, external display DPMS off first): PASS (success=1, wake NUB.SPMI0Sw3IRQ). s2idle and physical replug were not run.

A DP tunnel the display side refused a pipeline waits for one: its DP IN
request stays live, and the DP IN work retries it every two seconds.
Each retry admits an attempt to hand the request to a display, and DCP
may call Activate on that binding before the attempt returns. The tunnel
is reported as waiting for a display throughout
(dp_tunnel_awaits_display()), so that its DPRX deadline is renewed while
the attempt makes its way to the display driver, however long that
takes. That report cannot tell a connection manager that wants to
re-link the tunnel whether a display is being woken through it now, and
a check made under the DP IN lock is stale once the lock is dropped: a
retry can be admitted before the tunnel is torn down.

Add two hooks for that, beside dp_tunnel_awaits_display(), which stays
as it is:
- dp_tunnel_retirable(): the tunnel of a given generation waits for a
  pipeline and no attempt to hand it to a display is admitted
  (apple_dpin_retirable()), so no display reads its DPRX. Only a hint,
  for when to decide a held re-link again.
- dp_tunnel_retire_waiting(): for a re-link of that tunnel, retire its
  request under the DP IN lock that admits attempts, as
  dp_tunnel_changed() does when a tunnel goes, unless an attempt is
  admitted already. A retired request admits no further attempt, so a
  retry due for it starts none.

The connection manager uses them in the next change. They are
registered on every host whose DP IN policy retries for a display
pipeline (apple_dpin_m1, _m3, _m4 and _m5), and only the shared-rate
path calls them (apple_dpin_m4: T8132 and T6040/T6041).

KUnit: apple_dpin_m4_retire_waiting.

Signed-off-by: Erik Bourget <[email protected]>
…e DPRX

Under TB_HOST_DP_SHARED_RATE both DP IN streams of an Apple ATC PHY run
at one link rate, so a host DP tunnel up at HBR3 is torn down and set up
again at HBR2 when a second one is wanted. A dock that reports its
displays one at a time (a CalDigit TS5 with two monitors) gets the first
tunnel at HBR3 and, a moment later, the second display has it re-linked.
By then the first tunnel's DP IN adapter has been handed to the display
side, and the display's firmware is waking it from its Activate call.
The re-link replaces that tunnel, and with it the DP IN request the
display was handed, under the call: the Activate is refused (-ESTALE),
the firmware trains a link that never comes, and on a replug its later
calls time out and the dock's displays stay dark.

Hold such a re-link (TB_DP_RELINK_HOLD) while the tunnel's DPRX read is
under way (tb_dp_tunnel_release_display()). Only a host that still waits
for a display pipeline for the tunnel, with no attempt to hand it to a
display admitted, lets it go now: it retires the tunnel's display
handoff atomically against such an attempt (dp_tunnel_retire_waiting()),
and the re-link is made at once, as before. On HOLD, pairing leaves the
host DP IN adapters alone, as it does while a system sleep is in
progress. The re-link of a tunnel left alone to a higher rate is held
the same way.

A held re-link is decided again (tb_dp_relink_unhold()) once no display
reads the tunnel's DPRX:
- its DPRX read is done, timed out or given up (tb_dp_tunnel_active());
- the DPRX work finds the host waiting for a display pipeline for it
  with no attempt to hand it to a display admitted (the new
  await_callback, which asks dp_tunnel_retirable(), on each such pass).
  While a pipeline retry attempt runs, the DPRX deadline is renewed as
  before, and nothing is decided again until the attempt ends.
The display then sees a plain unplug and plug at the shared rate.

Whether a re-link is still wanted is decided from the tunnels and the
adapters, not from the hold (tb_dp_relink_wanted()): to HBR2 while a
host DP tunnel is up above HBR2 and another host pair is free, to the
higher rate while the tunnel left alone is marked and its debounce is
over. It survives a pass that defers the re-link for system sleep
instead of holding it, and a pass still queued for thaw.

When the tunnel's DPRX read times out while its re-link is wanted, the
tunnel is kept, listed, instead of torn down with its DP IN adapter
dropped, and the re-link is made the way it is for any tunnel: by
pairing (tb_dp_host_relink() on the same pair at HBR2 first, then the
other display) and by the re-link work (the re-link up at the higher
rate, with its immediate fallback to HBR2 and its debounce bookkeeping).
A tunnel re-linked up that did not come up is kept the same way, for its
HBR2 fallback. The wanted re-link comes first: when another display
arrives while that tunnel reads its DPRX at HBR3, the re-link down it
waited for keeps it on its own pair, where the fallback would have
paired both displays afresh, possibly on swapped DP IN adapters. Until
pairing or the re-link work, on the ordered domain queue, releases it
(tb_dp_relink_kept()), the DPRX work may still hold the tunnel and its
paths, so every pass holds its re-link, also an inline one such as
tb_complete()'s. Released, a kept tunnel whose re-link is not wanted any
more (the other display went, or another came) is handled as any DPRX
timeout (tb_dp_tunnel_inactive()): set up at HBR2 again once, now on
its own pair (tb_dp_host_relink()), after a re-link up; torn down with
its DP IN dropped otherwise. A kept tunnel is an ordinary listed tunnel:
an unplug, a router removal or a suspend that releases DP takes it
down.

No re-link runs during a system sleep transition, and that is now kept
in one place, tb_dp_relink_enter(): every DP tunnel the re-link
machinery tears down or sets up goes through it and is torn down or set
up only while it holds the system sleep admission. That covers the
re-link down, the re-link up, a kept tunnel's HBR2 fallback or teardown,
and the pairing pass that sets up what one of those made room for (the
other display's tunnel after a re-link down), or tore down and could
not set up again (dp_relink_pairing). That pass is entered in
tb_dp_host_rate_limit() and holds the admission through its last setup
in tb_tunnel_dp(). During a transition nothing is torn down or set up:
the work stays recorded (deferred pairing, the kept tunnel with its
adapters, the re-link up mark, the pending pass) and the re-link work
does it from the domain queue once the transition is over, armed again
at thaw, resume and complete. The HBR2 cap left by an HBR2 fallback that
could not set its tunnel up again is kept until a pass that may pair is
admitted, so the display is set up at HBR2 then, not at the rate that
just failed. Pairing outside the re-link machinery is as before.

These pairing requests are recorded before the hotplug check, so a
re-link decided again while hotplug is stopped for system sleep
(tb_freeze_noirq()) is replayed at thaw, resume or complete. A stopping
domain records nothing.

The KUnit tests cover the decision and, through the connection manager
with the real DPRX work and callback: a second display arriving while
the first one reads its DPRX, after which the display side refuses the
first a pipeline; a pipeline retry admitted when the second display
arrives, kept while it runs and decided again once it is refused; and a
DPRX read ending while hotplug is frozen or the domain stops.

Signed-off-by: Erik Bourget <[email protected]>
A display's Activate on a DP IN binding that is no longer the live one
is refused with -ESTALE, and the display side logs only that number.
Log why at info level, with the binding's generation and the requested
and admitted ones: its tunnel was retired (it went, with no new one),
replaced (a new tunnel's request took the adapter), or has no admitted
attempt (none yet, or its attempt failed). A Deactivate after the tunnel
went is routine, on every unplug: debug only.

Signed-off-by: Erik Bourget <[email protected]>
Compile the connection manager's pairing, re-link and DPRX completion
code (tb.c), the DPRX work (tunnel.c) and the Apple glue's DP IN
request, binding and display hooks (apple.c, apple-dpin-state.c,
apple-dpin-request.h) from the tree against host mocks: an ordered
domain queue, the freezable queue, a clock, tunnels whose paths hold
their HopIDs until their last reference goes, and a display side that
admits, fails or completes its attempts where each case puts them. The
real DPRX work and callback bring the held pair up.

Thirty-eight cases replay a two-display dock: a cold plug, an unplug and
a replug; the display side refusing the first display a pipeline after
the hold; a pipeline retry admitted when the second display comes, then
handed the display or refused again; a waiting request retired before
its retry, with the retry run while pairing tears the tunnel down; a
completion while hotplug is frozen, then thaw, or while the domain
stops; and the re-link of a lone tunnel to a higher rate, held until
its DPRX read is done or its display waits for a pipeline. With each
host policy that retries for a display pipeline (apple_dpin_m1, _m3,
_m4 and _m5), a retry that takes longer than the DPRX deadline to reach
the display keeps its tunnel, not active, until DPRX completes.

The rest time the held tunnel's DPRX read out. To HBR2: with the second
display still there or gone; after a pass that deferred the re-link for
system sleep (nothing is torn down or set up again until the PM gate
reopens, and the tunnel is dropped then if the second display went
meanwhile); with the pairing pass queued for thaw; with an inline
pairing pass, as tb_complete() makes, in the window before the DPRX work
drops the tunnel; and with the first display on the second DP IN after a
failed setup (the displays keep their DP IN adapters). Up, at HBR2:
re-linked on the same pair at HBR3, then counted for the debounce of the
next re-link down; at HBR2 at once if HBR3 cannot be set up; at HBR2
once more if HBR3 does not come up; nothing set up while the PM gate is
closed; the same inline pass; and a router that replaces the dock at the
same route before thaw, paired as a new display. Down from HBR3 again:
the second display comes back while the tunnel re-linked up reads its
DPRX, and that read times out; the re-link down is made on the same pair
first, the displays keep their DP IN adapters, and with the PM gate
closed no tunnel is set up until it reopens; if the second display goes
again before thaw, the tunnel is set up at HBR2 again, on its own pair.

The PM gate mock counts its readers and can close the moment the last
one leaves, as the PM notifier does. With it closed at each path into
tb_dp_relink_enter(), nothing is set up until it reopens, and then the
work is done: the re-link down; the re-link up, with the gate closing
after the re-link work's own check; the HBR2 fallback of a lone tunnel
re-linked up, and of one whose re-link down the second display waited
for until it went again, hotplug on or frozen until thaw (the sink
then lights at HBR2); a kept tunnel's teardown; and the pairing pass
after that teardown, after a failed re-link, or after a re-link down
that made room for the second display (whose tunnel is set up only once
the gate reopens). When the HBR2 fallback of a tunnel re-linked up
cannot set it up again, the pass that pairs its display again, with the
gate open or once it reopens, sets it up at HBR2.

Twenty-nine negative controls each put one piece back as it was, or
take a fix out; each must fail the replay. Among them, one takes the
gate out of tb_dp_relink_enter() and one per path goes around it.
Run with the host tests.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 26, 2026 16:06
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 3b32d06f: not ready yet

Check Detail
CI at head no failing: KUnit macsmc
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at 3b32d06f
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132: J713/J715 Air, J604 14" Pro, J773g mini) and M4 Pro/Max (T6040/T6041), the hosts with TBHOSTDPSHAREDRATE; the refused-call log line on every Apple host with DP IN display handoff.

Areas: area:gpu, area:usb

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

@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.

The current J713 boot kept the TS5 disconnected, so it does not exercise the path this change modifies. The disconnected boot and replay cases check different things. Please post an exact-head cold-plug and replug row with both displays and an observed HBR3 to HBR2 transition, followed by suspend and resume with the dock attached. Include the first and second tunnel outcomes and check that both displays recover. The new work is shared with T6040/T6041, so include one affected peer. Existing hosted KUnit jobs are still queued or have earlier failures. Keep held for those gates.

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

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Hosted CI at 3b32d06f7ae5 is green: Apple build and KUnit (apple-build and all 15 hosted KUnit jobs), Host tests, pr-text, and pr-readiness all completed with SUCCESS (0 failing checks). The hosted KUnit matrix does not run thunderbolt or apple-dpin-lifecycle separately; the full local KUnit run across those 120 tests (119 pass / 1 skip) passed at 3b32d06f7ae5 as recorded in the PR body.

Re-verified locally at 3b32d06f7ae5:

  • python3 tools/asahi/tb-dp-relink-hold-tests.py: 38/38 cases pass and 29/29 negative controls caught under both cc and CC=clang.
  • python3 tools/asahi/tb-dp-repair-tests.py --mutations: 16/16 cases pass and 16/16 mutants caught.
  • Clean merge with current main (aa3351bc8e6f, no conflicts).

The J713 (T8132) dock rows now ran on hardware with the CalDigit TS5 and two monitors (DP-1, DP-3) attached, in a trial kernel built from main 9867e173efb8 plus #2673 (fd3dc16c121b), #3273 (7f21093a0d31) and this head, default command line, one-shot boot. Results are in the PR body under Tested and Evidence:

  • Cold boot docked: eDP-1 2560x1664@60 and DP-1 and DP-3 3840x2160@60 up. The first display's tunnel came up at 8100 Mb/s per lane, the re-link was held until its display had read the DPRX (another DP tunnel is wanted: re-linking once its display has read its DPRX), then ran at 5400 Mb/s per lane with the displays on dpin0 and dpin1 and no refused-call line.
  • 3 DPMS off/on cycles and 3 s2idle suspend/resume cycles (rtcwake -m freeze -s 5) with the dock attached: all three outputs back at the same modes each time, boltctl authorized throughout, no thunderbolt or DP error line, 0 failed units, 0 AppArmor denials, 0 new kernel err lines against the J713 default kernel docked.

Still open under **Not yet:**:

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train note at 3b32d06f: this is mergeable, but most of the change is in the generic Thunderbolt core (tb.c +425/-49, tunnel.c) rather than the Apple glue, so it needs the App's full review at this head and rows on two families with DP-over-USB4 tunnels before the train takes it: a J616s (T6040) and a second Apple USB4 host (J316s or J414c). Each row: a USB4/TB dock with a DP display, a shared-rate re-link while EDID/DPRX reads are in flight (your repro), display hotplug x5, a short s2idle, and no tunnel or DP errors. The host suite (tb-dp-relink-hold-tests.py) and the KUnit additions are noted. I'll do a line-by-line pass once the App review is in.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026
@aurora-silicon-review
aurora-silicon-review Bot dismissed their stale review December 1, 2026 05:05

Dismissed under the 12-01 merge bar: this review's blockers were not shown failures (CI/rows/rebase/design or re-run asks). Follow-ups, not blocking: No code affirmation; follow-ups: J713 cold-plug/replug HBR3->HBR2 row with suspend, queued KUnit (peer not required)

@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified 3b32d06f7ae5 with no code changes needed:

  • Mergeability: git merge-tree --write-tree against current main (a171afd2123f) is clean with zero conflicts. Companion J713 display PRs are still open: drm/apple, soc: apple: external displays on the M4 MacBook Air (J713) over USB-C on macOS 27.2 #2673 is CONFLICTING against main, and drm/apple: drive a two-display dock from the firmware-27.2 T8132 dcpexts #3273 is MERGEABLE against its stacked base j713-dcpext/air-dcpext-272.
  • Local checks at 3b32d06f7ae5:
    • drivers/thunderbolt/.kunitconfig.apple-dpin (arm64 QEMU, LLVM=1): 120 tests (119 passed, 1 skipped: apple_g17_rx_util_min_test needing CONFIG_UCLAMP_TASK), including all 79 thunderbolt and 37 apple-dpin-lifecycle cases.
    • tools/asahi/tb-dp-relink-hold-tests.py (cc and CC=clang): 38/38 cases pass and 29/29 negative controls caught.
    • tools/asahi/tb-dp-repair-tests.py --mutations: 16/16 cases pass and 16/16 mutants caught; tb-cio-sleep-tests.py, tb-dock-pm-tests.py, tunnel-route-tests.py, tbnet-refill-tests.py, and t8132-usb4-policy-tests.py all pass.
    • Full arm64 LLVM=1 linux-j313 kernel, modules, and dtb build passes cleanly (Apple build and KUnit run 45855605129 attempt 3 was cancelled after 4 hours and needs a CI re-run).
  • Review and hardware status:
    • The earlier review (2026-11-27) was dismissed, so a fresh review at 3b32d06f7ae5 is still needed.
    • J713 (T8132, firmware 27.2) docked rows on the CalDigit TS5 with two 3840x2160 monitors (DP-1, DP-3) already ran at 3b32d06f7ae5 (cold boot docked observing the held HBR3-to-HBR2 re-link, 3 DPMS cycles, 3 s2idle cycles). Physical dock/monitor replug on J713 awaits physical access.
    • J313 (M1 Air, T8103, non-shared-rate Apple USB4 host apple_dpin_m1) docked regression row on the CalDigit TS5 + DP-2 (3840x2160@120) ran at 3b32d06f7ae5 in a composite trial kernel (origin/main 429e7e15f122 + #3335, #3506, #3508, #3269, #3359, #3289; 12/12 drivers/thunderbolt/* .o/.text byte-identical vs single-PR merge): TS5 authorized at cold boot, 0 thunderbolt/tunnel/usb4 error lines, 5 external DPMS off/on cycles clean (each external DPMS cycle logs one DCPDP2XService admission failed: -19 line + IOMFB syslog noise, not yet compared with the default kernel), 1x deep S2R (rtcwake -d rtc1 -m mem -s 30, ext DPMS off first: success=1), 0 failed units, 0 AVC denials. s2idle and physical replug were not run.
    • J616s (T6040), J316s, and J414c are not available in this lab, so those rows will need regression runs from owners with that hardware.

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

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the DPRX handoff, tunnel cancellation, HBR2 fallback and suspend admission paths. The docked J616s and J316s or J414c rows are still needed, including physical hotplug and the shared-rate re-link during EDID/DPRX reads.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

We carry this PR in our J713 (M4 Air, T8132) and J313 (M1 Air, T8103) daily kernels.

On TB_HOST_DP_SHARED_RATE hosts like J713, attaching a dual-monitor Thunderbolt dock (CalDigit TS5) that brings displays up one at a time caused the second display's tunnel to re-link the first tunnel from HBR3 to HBR2 while DCP was still waking its DP IN and reading the DPRX, replacing the DP IN binding underneath display bring-up. Holding the shared-rate re-link until DPRX handoff finishes (along with cleanly retiring tunnels awaiting a pipeline and logging refused stale-binding calls) resolves that race.

Running smoothly on our J713 daily kernel (paired with #3273 for dual-display dock bring-up) and on our J313 daily kernel.

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

area:gpu Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m4 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants