Skip to content

phy: apple: atc-t6050-dp: run a DP tunnel clock only for its link - #2036

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/t6050-dp-tunnel-clock-restart
Nov 16, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/t6050-dp-tunnel-clock-restart

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Part of a set of seven J714s external-display PRs, measured together (table below): #2032 EDID defaults, #2033 atc tunnel open, #2034 tunnel-only first (stacks on #1921), #2035 merged-mode limit, #2036 tunnel clock, #2037 DPTX connection DP IN and #2038 DP IN bandwidth allocation (merge those two together). Suggested order: #1921, #2006, then the set in any order.

What

One commit, phy: apple: atc-t6050-dp: run a DP tunnel clock only for its link. It touches only the T6050 Type-C PHY driver.

How the driver ran a port's four USB4 DP tunnel clocks before:

  • the port's first clock started the other three with it, at its rate and with no user. A display that came later at another rate had its clock's rate changed in place;
  • a clock whose display went kept running while another clock ran;
  • a stop cleared the enable before it parked the switch.

Now:

  • each clock has the rate of its own link, or none;
  • a clock starts from off at that rate when its link is set up, and stops to off when the link goes;
  • a new rate for a running clock stops it and starts it again from off;
  • every start and stop applies all four clocks in order. A clock with a rate gets its gate on, then its power manager source, then its switch field and enable. A clock without one gets its switch parked and its enable cleared, then its gate off;
  • the USB4-mode park is the same walk with no clock running;
  • clocks that no display uses never run.

This supersedes an unpublished earlier version, carried by the k2b–k4 kits, that restarted a clock from off only for a new rate. It includes that change: a clock's rate now only ever changes from off.

Stacking

None. This applies to integration/aurora alone and is independent of #1921 and #2006. In the kits it ran with them.

Tested

The dock's JTG on DP IN 0 (HBR2) and the G81SF on DP IN 1 (HBR3) use tunnel clocks 1 and 2 on the right port.

kit clock log G81SF on DP IN 1
k4 (before, with that earlier version) clocks 2–4 started with clock 1 at HBR2 (no log line for them), then DP tunnel clock 2: link rate 0x14 to 0x1e, restarting from off for the G81SF dark: 8 IRQ_HPD, 3 relinks
k5 (this) clock 1 started at HBR2 and clock 2 at HBR3, each from off; no rate change; clocks 3 and 4 not started dark: 7 IRQ_HPD, 3 relinks
k6 (this + #2037 + #2038) the same as k5 lit at 3840x2160@120, no IRQ_HPD

So this change alone doesn't keep the G81SF's link. With the two DP IN 1 changes on top (#2037, #2038) it holds, and all four displays light. Whether k6 still needs this change was not measured: no kit had those two without it.

In k5 each relink of the G81SF stops clock 2 and starts it again from off at HBR3 (DP tunnel clock 2 stopped, then DP tunnel clock 2: link rate 0x1e, ...). No gate not released, switch status … not on or … still on was logged in any kit.

Compile: fedora-kcheck (cross build, M5 intg6 config): OK (vmlinux, Image and modules linked), 0 new warnings. checkpatch --strict: 0 errors; its one warning is the From/Signed-off-by name mismatch these commits always have.

Rig and kits

J714s (MacBook Pro 14", M5 Pro):

  • internal panel;
  • Dell S2725QC (3840x2160@120) on the left-front port, DP alt mode;
  • Thunderbolt 5 dock on the right port: JTG S123 (1920x1280@60) on DP IN 0, Samsung Odyssey G81SF (3840x2160, up to 240 Hz) on DP IN 1.

Each kit was integration/aurora 514ae1f + #2006 (which carries #1921) + #2018 as it was at 0521255 (its earlier PHY-side version) + the changes up to that row. Built natively on the M5, one-shot test boot, read-outs only (sysfs, debugfs, kernel log, hyprctl monitors), then the default kernel restored and verified byte-identical. Since 514ae1f, integration/aurora has gained only #2022, which touches none of these files. The k6 tree is the tree of all seven PRs of this set merged on #2006, apart from a diagnostic log commit used only in the kits and the serial keyword added to one log line in the EDID PR.

kit adds Dell (left-front) JTG (dock DP IN 0) G81SF (dock DP IN 1) DP IN 1 in the kernel log
stock (default kernel) 3840x2160@120 1920x1080@60, no EDID, no name dark
k2b EDID defaults, and an earlier tunnel clock restart not up in that boot ¹ 1920x1080@60 ², "JTG S123" dark 11 IRQ_HPD, 3 relinks, 5 failed paired mode sets
k3 + atc tunnel open, + tunnel-only first 3840x2160@120 1920x1280@60 dark 10 IRQ_HPD, 3 relinks, 4 failed paired mode sets
k4 + merged-mode limit 3840x2160@120 1920x1280@60 dark 8 IRQ_HPD, 3 relinks, 1 failed paired mode set
k5 + no paired call under the limit, + tunnel clock only for its link 3840x2160@120 1920x1280@60 dark 7 IRQ_HPD, 3 relinks, no failed paired mode set, no clock rate change
k6 + DPTX connection DP IN, + held CM Ack bandwidth allocation 3840x2160@120 1920x1280@60 3840x2160@120 no IRQ_HPD, no relink

The internal panel ran at 3024x1964@120 in every row. k6 was read at about 60 s and 150 s after boot, with the same result both times, and with no oops, WARN, DART fault or GPU fault.

¹ The left-front port's PD controller came up late in that boot and the Dell never entered DP alt mode. None of these changes touch that path.
² In k2b the JTG was on DP-1 and the compositor ran it at 1920x1080; from k3 on it is DP-5 at its native 1920x1280.

Neo rows needed

No. atc-t6050-dp.c binds only T6050 PHYs.

🤖 Generated with Claude Code

On the J714s dock, a 4K display on the dock's second DP IN never holds its
link beside a display on the first: the sink raises IRQ_HPD after each
training, and the DCP firmware drops it and relinks.

The driver ran the port's tunnel clocks unlike macOS:
- the port's first clock started the other three with it, at its rate and
  with no user, so the second DP IN's clock already ran at the first
  display's rate when its own link came up, and took its own rate in
  place; the two clocks no display uses kept running;
- a clock whose display went kept running while another clock ran;
- a stop cleared the enable before it parked the switch.

macOS, measured on this setup, starts a clock once, from off, when its DP
IN's link is set up, at that link's rate. The clocks no display uses never
run, and no clock takes another rate while it runs. After any change it
walks all four clocks in order: a clock with a rate gets its gate on, then
its power manager source, then its switch field and enable; a clock
without one gets its switch parked and its enable cleared, then its gate
off. A running clock's source and switch are written again as they are.

Do the same. Each clock has the rate of its link, or none. A start and a
stop both apply all four clocks in that order, a stop takes the clock to
off, and a new rate for a running clock stops it and starts it again from
off. The park in USB4 mode is the same walk with no clock running.

On a J714s with a 1920x1280 display on the dock's DP IN 0 and a 3840x2160
display on DP IN 1, each clock now starts from off at its own link's rate,
no clock changes rate while it runs, and the port's other two clocks stay
off. This alone does not keep the DP IN 1 display's link: its sink still
raises IRQ_HPD after training.

Signed-off-by: Diljit Singh <hey@djdev.me>
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.

1 participant