Skip to content

SM8750: restore dock DisplayPort output broken by the 7.1 bump - #3068

Merged
loki666 merged 1 commit into
ROCKNIX:nextfrom
aanze:pr-typec-mux-probe-defer
Jul 27, 2026
Merged

SM8750: restore dock DisplayPort output broken by the 7.1 bump#3068
loki666 merged 1 commit into
ROCKNIX:nextfrom
aanze:pr-typec-mux-probe-defer

Conversation

@aanze

@aanze aanze commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • What is the goal of this PR? Restore USB-C dock / KVM DisplayPort output on the AYN Odin 3 (SM8750), which has been dead since the 7.0.11 -> 7.1.3 kernel bump (6166516). Plugging a dock gives no video at all — the connector never leaves disconnected and the display shows no sign of detection.

The 7.1 merge window added a "skip duplicates" filter to typec_mux_match() / typec_switch_match() in drivers/usb/typec/mux.c and started passing the output array in as the match data. struct device is the first member of struct typec_mux_dev / struct typec_switch_dev, so container_of() on a NULL device yields NULL. When class_find_device() finds nothing — the normal case while the mux driver has not probed yet, here the wcd939x-usbss retimer on i2c — the dedup loop compares that NULL against an array slot that is also NULL, matches, and returns NULL instead of ERR_PTR(-EPROBE_DEFER). The connector is then built without its mux, permanently, and the DP lanes and the AUX/SBU pair are never routed.

The two dedup arrays are also uninitialised stack, yet every slot is read before fwnode_connection_find_matches() has filled them, so a valid mux can be dropped by a chance comparison against stack garbage.

Kernel patch 0517 bails out with -EPROBE_DEFER before the dedup loop when no device was found, and zero-initialises both arrays. This is not Odin 3 specific: any platform whose Type-C mux probes after the connector is affected.

Testing

  • How was this tested? Built a ROCKNIX image for SM8750 and flashed an AYN Odin 3, with a USB-C KVM driving a DisplayPort monitor. A/B against release images on both sides of the bump (7.0.11 works, 7.1.3 does not), same dock and same instrumentation.
  • Test results:

Before (7.1.3) — the firmware enters DP alt mode and raises HPD, the driver decodes it correctly and notifies DRM, then the very first DPCD read times out, so the link never trains:

pmic_glink_altmode: NOTIFY svid=0xff01 mux_ctrl=3 pin_assignment=4 hpd_state=1
aux_hpd_bridge:     HPD notify status=1          (connected)
[drm:msm_dp_display_host_phy_init] core_init=1 phy_init=0
[drm:drm_dp_dpcd_probe] dpu_dp_aux: 0x00102 AUX -> (ret=-110)
[drm:msm_dp_bridge_detect] link_ready = false

After (same image + this patch):

DP status : connected
DP enabled: enabled
EDID      : 256 bytes
modes     : 3840x2160  4096x2160
AUX -110  : 0

Picture on the external display, confirmed on device.

Additional Context

  • An AUX -> (ret=-110) timeout while every software layer reports success is the signature of the lanes never being routed — worth remembering for similar reports.
  • Reached by elimination: every other file of the DP path is byte-identical between 7.0.11 and 7.1.3 (dp_drm.c, dp_display.c, aux-hpd-bridge.c, pmic_glink_altmode.c, wcd939x-usbss.c, phy-qcom-qmp-combo.c, phy-core.c, dispcc-sm8750.c, drm_bridge.c, drm_bridge_connector.c), as is the live device tree, so mux.c was the only behavioural change left.
  • The fix belongs upstream in the kernel; carrying it here fixes ROCKNIX users now. Other users have reported no dock video on ROCKNIX, which this would explain.
  • Freeze is active (last 7 days of the month) — this is a bugfix and needs the bugfix label, which I do not have permission to set.

AI Usage

Did you use AI tools to help write this code? YES

Since the 7.0.11 -> 7.1.3 kernel bump, plugging a USB-C dock or KVM
gives no video at all on the AYN Odin 3: the DP connector never leaves
"disconnected" and the screen shows no sign of detection.

The 7.1 merge window added a "skip duplicates" filter to
typec_mux_match() and typec_switch_match() in drivers/usb/typec/mux.c,
and started passing the output array in as the match data. struct
device is the first member of struct typec_mux_dev and struct
typec_switch_dev, so container_of() on a NULL device yields NULL. When
class_find_device() finds nothing - the normal case while the mux
driver has not probed yet, here the wcd939x-usbss retimer sitting on
i2c - the dedup loop compares that NULL against an array slot that is
also NULL, matches, and returns NULL. The caller reads that as "no such
connection" instead of the -EPROBE_DEFER it used to get, so the
connector is built without its mux, permanently, and the DP lanes and
the AUX/SBU pair are never routed.

The two dedup arrays are also uninitialised stack, yet every slot is
read before fwnode_connection_find_matches() has filled them, so a
valid mux can be dropped by a chance comparison against stack garbage.

Add kernel patch 0517: bail out with -EPROBE_DEFER before the dedup
loop when no device was found, and zero-initialise both arrays.

This is not Odin 3 specific - any platform whose Type-C mux probes
after the connector is affected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@loki666 loki666 added the bugfix label Jul 27, 2026
@loki666
loki666 enabled auto-merge July 27, 2026 15:56
@loki666
loki666 added this pull request to the merge queue Jul 27, 2026
Merged via the queue into ROCKNIX:next with commit 75365c9 Jul 27, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants