Skip to content

drm/apple: retry a fixed HDMI link that did not come up - #3588

Draft
RyanTheTide wants to merge 1 commit into
mainfrom
fix/dcp-fixed-hdmi-retry
Draft

RyanTheTide wants to merge 1 commit into
mainfrom
fix/dcp-fixed-hdmi-retry

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What

On the K114s (T6050), the built-in HDMI port reads disconnected with a monitor plugged in, so no picture and no CEC (the CEC adapter has no physical address). HPD itself works: the hdmi-hpd GPIO reads high, and the driver logs dcp_fixed_hdmi_reconnect: DP2HDMI HPD connected:1. The DP link to the on-board DP-to-HDMI converter doesn't come up at boot. The firmware reports link fault 22 (DEVICE_BUSY_TIMEOUT) and 24 (DEVICE_NOT_STARTED) on target 0:3, then dcp_dptx_connect: timed out waiting for port 0 link configuration and HDMI DPTX connect failed: -110, twice within 5 s. After that nothing tries again: a fixed HDMI output is connected when its DCP starts and on an HPD edge, and HPD stays high.

The retry that exists for this (dcp_external_retry() -> dcp_fabric_hdmi_retry()) only runs for the T6030 external processor. This gives every other fixed HDMI output its own bounded retry. After a failed connect while HPD is high, it connects again through dcp_fabric_hdmi_retry(), as an HPD edge would: up to 4 times, 2 s apart, then twice as long each time (2/4/8/16 s). A successful connect or an unplug resets the count. An HPD edge drops a pending retry (it connects by itself) but keeps the count, so a converter that drops HPD on each failed link stays bounded. The work item follows the other HDMI work items through suspend and removal. The policy is a pure helper (dcp_fabric_hdmi_retry_delay()) with a KUnit case. T6030 behaviour is unchanged.

Tested

Tested: KUnit at 1f9f87b (arm64 QEMU): dcp-fabric 118/118 including the new fabric_hdmi_retry_delay, apple-drm 344/345 (1 unrelated skip). Hardware row pending.

  • The failure, read-only on the K114s today (7.3.0-k114sstack5 with K114S-EXTDISP2's HDMI Stage 2): HPD GPIO high, the two failed connects above, card1-HDMI-A-1 disconnected with the MSI plugged into HDMI 2, /dev/cec0 at physical address f.f.f.f.

Risk: one-way · fixed HDMI outputs on non-T6030 SoCs (built-in HDMI of the T6050 K-boards; also M1/M2/M3 Pro/Max laptops and minis whose HDMI link fails to come up): up to 4 extra connect attempts over ~30 s while HPD is high. Outputs that connect first time are unchanged.

Not yet

On the K114s (T6050) the built-in HDMI port's link to its DP-to-HDMI
converter failed at boot: HPD high, but the firmware reported link
faults (DEVICE_BUSY_TIMEOUT, DEVICE_NOT_STARTED) and dcp_dptx_connect()
timed out twice within 5 s.  Nothing tried again afterwards: the driver
connects a fixed HDMI output when its DCP starts and on an HPD edge, and
HPD stayed high, so the connector stayed disconnected for good.

The retries that exist for this are tied to the T6030 external
processor.  Give every other fixed HDMI output its own: after a failed
connect while HPD is high, connect again through dcp_fabric_hdmi_retry(),
as an HPD edge would, up to four times, 2 s apart and then twice as long
each time.  A successful connect or an unplug resets the count; an HPD
edge drops a pending retry, since it connects by itself.  The work item
follows the other HDMI work items through suspend and removal.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 29, 2026 02:00

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

Verdict: HOLD at 1f9f87b1 — code and KUnit coverage are clean; awaiting queued CI and the exact-head K114s HDMI/CEC hardware row.

Blockers:

  1. Exact-head K114s hardware row at 1f9f87b1 (confirming HDMI-A-1 connect recovery and HDMI-CEC behavior, or recording retry behavior) and green queued CI checks (21 checks queued).

Checked: Full 6-file diff (drivers/gpu/drm/apple/{dcp-fabric-effects.h,dcp-fabric-test.c,dcp-fabric.c,dcp-fabric.h,dcp-internal.h,dcp.c}), hdmi_retry_wq init/enable/disable/cancel lifecycle across probe/suspend/resume/HPD-edge, retry-count bounding and callers of dcp_hdmi_connect_failed(), T6030 external_native isolation, and commit Signed-off-by.

Evidence
  • Retry policy and workqueue lifecycle:
    • dcp_fabric_hdmi_retry_delay() cleanly bounds retries to 1..4 (2/4/8/16 s) and returns 0 for 0, -EAGAIN, -ESTALE, -ESHUTDOWN, 0, or > 4 (no UB shift). Covered by fabric_hdmi_retry_delay (118/118 dcp-fabric KUnit, 344/345 apple-drm KUnit).
    • dcp_hdmi_connect_failed() leaves dcp->external_native (T6030) unchanged, ignores Type-C outputs and ports without hdmi_hpd, resets hdmi_retries on ret == 0, clamps hdmi_retries to DCP_HDMI_RETRIES once exhausted (preventing counter wraparound on repeated HPD pulses), and schedules hdmi_retry_wq on system_freezable_wq.
    • hdmi_retry_wq is initialized disabled in dcp_fabric_init(), enabled in dcp_enable_typec_work() (called before both dcp_enable_dp2hdmi_hpd() at probe and dcp_fixed_hdmi_reconnect() at resume), synced/disabled in dcp_disable_typec_work(), and cancelled on HPD edges (dcp_dp2hdmi_record_edge()) without resetting hdmi_retries.
    • Checked all callers of dcp_hdmi_connect_failed() (dcp.c:5402, dcp-fabric.c:5493,5689,5696): no double-counting on any connect or retry path.
  • Non-blocking note: In dcp_fixed_hdmi_reconnect() (dcp.c:5403-5408), the else if (!connected) branch (e.g., if a monitor that exhausted all 4 retries is unplugged during suspend and the system resumes without an HPD IRQ) does not reset dcp->hdmi_retries to 0, so a different monitor plugged in later would start at the exhausted count until the next unplug/connect success. Also, the PR body lists Risk: one-way, though reverting a retry helper is two-way.
  • Remaining merge gate: Once queued CI passes and the exact-head K114s row lands at 1f9f87b1, this is ready to approve and merge.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at 1f9f87b1: not ready yet

Check Detail
CI at head running running: kunit, apple-build, host-tests, pr-text / pr-text, KUnit ane-boot, KUnit ane-pm
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 1f9f87b1, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: one-way · fixed HDMI outputs on non-T6030 SoCs (built-in HDMI of the T6050 K-boards; also M1/M2/M3 Pro/Max laptops and minis whose HDMI link fails to come up): up to 4 extra connect attempts over ~30 s while HPD is high. Outputs that connect first time are unchanged. Not yet - K114s row: HDMI-A-1 connected to the MSI after the retry (or the retry log showing it doesn't help, which would point at the PHY/converter bring-up in #3498 / aura#559), then the HDMI-CEC proof on it.

Areas: area:display

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

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware row on the K114s (T6050 built-in HDMI into the MSI MPG 325CQRXF), 2026-11-29, done by K114S-EXTDISP2 with this branch's appledrm module (bridge6 kernel 7.3.0-k114sstack5):

  • Boot 1 (this PR on its own, plus a debug-only PHY module): the first connect at 1.6 s fails with link faults 22/24 on target 0:3 (connect failed: -110). The retries run as designed at 10.2 s, 20.4 s and 38.9 s, and each fails the same way (20 link faults in total). No DCP crash.
  • Root cause (K114S-EXTDISP2): nothing starts the fixed (non-Type-C) T6050 ATC3 DP PHY before the DCP connects. Type-C PHYs are started by the mux; this one never gets set_mode/configure first. Boot 2, with a PHY variant that starts the PHY at probe: HDMI-A-1 connects on the first attempt (1.5 s, HBR3 x4, 2560x1440@60 lit, 0 link faults, 0 DCP crash), and no retry is needed.

So this PR is not the fix for the K114s HDMI. The fix belongs in the T6050 DP PHY driver (K114S-EXTDISP2's PR). I'm moving this PR back to draft. It only makes sense as robustness against transient link failures once the PHY fix lands. If no transient failure turns up in rows with the PHY fix, I'll close it.

@RyanTheTide
RyanTheTide marked this pull request as draft November 29, 2026 02:29
@github-actions github-actions Bot removed needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026

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

Verdict: MERGE at 1f9f87b16c0d

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: Full 6-file diff (drivers/gpu/drm/apple/{dcp-fabric-effects.h,dcp-fabric-test.c,dcp-fabric.c,dcp-fabric.h,dcp-internal.h,dcp.c}), hdmi_retry_wq init/enable/disable/cancel lifecycle across probe/suspend/resume/HPD-edge, retry-count bounding and callers of dcp_hdmi_connect_failed(), T6030 external_native isolation, and commit Signed-off-by.

Follow-ups (not blocking): queued CI, K114s HDMI/CEC row; reset hdmi_retries on resume-disconnected path; Risk is two-way

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:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant