Repository navigation
drm/apple: pass a Type-C sink's IRQ_HPD to the firmware's DPTX port, so a link the sink lost is trained again as a DP source does - #2879
Conversation
|
Review at 8945af3 (non-author, draft). No blocker in the code; the scope needs rows on more than the J775D, and one log point.
Points to consider:
Assisted-by: LLM (Claude:Opus 5.5) |
|
@funkzy checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
…so a link the sink lost is trained again as a DP source does On the M5 Ultra Mac Studio (J775D), a DisplayPort monitor on a USB-C port can come up with a signal and no picture: link training at boot reports errors, the mode set completes with the link reported up, and the sink then raises IRQ_HPD about every 19 s. Each request reached dcp_retrain_oob(), which applies the active mode again. On firmware 27 a mode set of an unchanged timing leaves the link as it is, so the display stayed blank until userspace set another mode. A sink raises IRQ_HPD to ask the source to read its status: its link lost lock, a display behind a branch device changed, or for HDCP, MCCS or a test request. Only the firmware's DPTX port can read that status, over AUX. The driver already passes the request to it for a T6030 external processor (dcp_external_sink_irq()) and for a USB4 tunnel (dcp_tb_event_work()). The connected Type-C path now does the same: dcp_external_sink_irq() becomes dcp_dptx_sink_irq(), for every connected DPTX link, and the alt-mode IRQ_HPD calls it instead of applying the mode again. Passing the request logs at dev_dbg() so repeated sink requests do not fill the kernel log; if the firmware cannot take the request, the driver logs at dev_info() and connects the display link anew, as before for T6030. H17P keeps applying the mode again; a sink the firmware disconnected and a running relink are unchanged. The apple-dcp transaction selftest stubs dcp_dptx_sink_irq() in the route-set scenario (verifying a connected sink's IRQ_HPD reaches it once, with no replay) and runs production dcp_dptx_sink_irq() directly to verify pass-through, reconnect fallback on firmware error, stop on disconnect error, and early return when disconnected or unavailable. Signed-off-by: Jeff Queisser <[email protected]>
8945af3 to
a287683
Compare
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at a2876837: code OK; merge after one more generation's row.
Checked
- The alt-mode
IRQ_HPDpath now goes to the firmware's DPTX port (dcp_dptx_sink_irq()), like the T6030 external and USB4 tunnel paths already do, instead of replaying the mode. - A sink the firmware disconnected is recovered through
dcp_dptx_recover_irq(). The H17P mode-replay branch was already there, so this adds no new gate. - 21/21 quiesce host tests (including the fallback case), CI 20/20, and your J775D (M5 Ultra) row.
Owed: this changes the shared path for every non-H17P USB-C DP pipe, and your "Not yet" lists M1/M2/M4. We'll post rows from our M2 (J473, USB-C to a monitor) and M4 Pro (J616s) at this head. If either firmware refuses the DPTX call, the disconnect + connect fallback shows up there. Then approve + merge.
|
Merge-train review at |
There was a problem hiding this comment.
Verdict: MERGE at a287683 after hardware and CI
Checked connected IRQ_HPD routing to DPTX firmware and the reconnect fallback. The fixture covers success, fallback and disconnect failure. Keep two-family J473/J616s testing of IRQ_HPD while HPD stays high, including picture recovery and flip timeout checks.
|
Merging at |
What: Pass a connected Type-C DisplayPort sink's
IRQ_HPDto the firmware's DPTX port viadcp_dptx_sink_irq()instead of replaying the active mode (which does not retrain the link on firmware 27 when timing is unchanged, per our tests), replacing#2604.Tested: J775D (Mac Studio, M5 Ultra) at
a2876837de69on baremain(859e8a29796c) under published Aura7bf44a63on 27.2 firmware: live USB-C DPIRQ_HPDpassed silently atdev_dbg, the firmware accepted the hand-off and the link recovered to1920x1080@75, 0 subsequentIRQ_HPDduring 25 s wait, 0 DCP crashes/recoveries, 0 new failed units, 0 new kernel errors.apple-dcpselftest (--group quiesce): 21/21 pass (connected-irq-hpd-to-firmwareanddcp-sink-irq-fallback).Risk: Two-way door · affects every non-H17P DCP pipe behind a Type-C port when a connected sink raises
IRQ_HPD; H17P keeps mode replay, and a firmware refusal falls back to disconnect + connect.Not yet: M1/M2-generation and M4 USB-C DP rows confirming those firmwares accept call 8 on the alt-mode path without hitting the disconnect + connect fallback.
Details
Why this shape
IRQ_HPDwith HPD held high to ask the source to read its status over AUX (lost link lock, downstream branch change, HDCP, MCCS, or test request). Only the firmware's DPTX port has AUX, and the driver already passesIRQ_HPDto it in two places:dcp_external_sink_irq()for T6030 external processors anddcp_tb_event_work()for USB4 tunnels. The alt-mode path was the one copy that answered withdcp_retrain_oob()(a mode replay that only retrains where a same-mode set resets the link).#2604's repeat-within-30-s heuristic with a power-cycle budget of two, each key on timing instead of the sink's own status and can blank a healthy display on non-linkIRQ_HPDrequests.dcp_external_sink_irq()todcp_dptx_sink_irq()and use that same DPTX sink-IRQ call on all three paths. Whether the link retrains is left to the firmware's DPTX port once it has the sink's request; if the firmware cannot accept the request,dcp_dptx_sink_irq()logs atdev_info()and falls back to disconnect + connect, as the T6030 path already did.dcp_dptx_recover_irq()) and active relinks (dcp_typec_sink_relink()) are unchanged.Change
One commit (
a2876837de69) onmain(859e8a29796c):dcp_external_sink_irq()todcp_dptx_sink_irq()indrivers/gpu/drm/apple/dcp.{c,h}and call it for connected Type-C sinks indcp-fabric.cinstead ofdcp_retrain_oob().IRQ_HPDhand-offs atdev_dbg()so repeated sink requests do not spam the kernel log, while keepingdev_info()on the reconnect fallback path.tools/testing/selftests/drivers/gpu/apple-dcp/transaction.pywithconnected-irq-hpd-to-firmware(verifying one hand-off and no replay) anddcp-sink-irq-fallback(exercising productiondcp_dptx_sink_irq()directly for pass-through,-EOPNOTSUPPreconnect fallback, disconnect-error stop, and early guards when unavailable or disconnected).Evidence
Testing
Own-base row on J775D (Mac Studio, M5 Ultra): kit
pr2879-2(windowpr2866-2879@20261126-0836) is baremain859e8a29796cplusa2876837de69(no other PRs carried), booted one-shot with a read-only root on the default J775D command line through the 27.2 stub under published Auraaura-main-7bf44a63(7bf44a63), dead-man armed, temperature guard active:IRQ_HPDrecovery: att = 11.779 sthe USB-C DisplayPort monitor raisedIRQ_HPD(sn201202x 1-08: DP partner raised IRQ_HPD).dcp_dptx_sink_irq()passed it silently atdev_dbg(nodev_infolog spam, no reconnect fallback). After the hand-off, the link dropped and the driver relinked the Type-C sink (1/3) 81 ms later, bringing the DisplayPort monitor up cleanly att = 14.671 s(1920x1080@75). Zero furtherIRQ_HPDevents occurred during the subsequent 25 s wait.card0-HDMI-A-1stayed connected and active (1920x1080) throughout; 0 DCP crashes or recoveries.iwd.service,systemd-networkd-persistent-storage.service), 0 new. ALARM has no SELinux, so there is no AVC count. 8 kernel error lines, all baseline onmainunder 27.2 (speakers safety, 3 lines from 27.2 GPU firmware without#2866,hid-generic, 3 lines of DCP undeclared provider clock index 0); 0 new kernel errors.python3 tools/testing/selftests/drivers/gpu/apple-dcp/transaction.py --group quiesce: 21/21 pass, includingconnected-irq-hpd-to-firmwareanddcp-sink-irq-fallback.Thanks to Ryan Murray and dj for their reviews of
#2604and the earlier draft of this PR.