[PATCH v2 09/20] drm/msm/dp: Unwind resources when enabling a stream fails
joonhoekim
26rote at gmail.com
Tue Nov 3 05:51:40 PST 2026
From: Joonhoe Kim <26rote at gmail.com>
On Fri, 09 Oct 2026 11:16:01 +0800, Xilin Wu wrote:
> Stream enable can fail after acquiring a runtime PM reference or
> starting the link. Returning directly leaks those resources, while a
> later disable can release a reference that was never acquired.
This leak breaks USB on a Lenovo Y700 Gen 5 (TB323FU, Kaanapali). I
tried parts of 08/20 and this patch as a fix for it. The result was
worse.
The sequence, seen with kprobes on v7.3 with out-of-tree board
support:
- A USB-C monitor is unplugged during s2idle. On resume, the stream
enable trains the link to the gone sink and fails. Nothing releases
the DP PHY init taken for it.
- At the next suspend entry (booted with no_console_suspend, so fbcon
restores the old mode), an enable on the disconnected connector
powers the DP PHY on, and msm_dp_ctrl_enable_mainlink_clocks() fails
with -EBUSY. The PHY power is not released either.
- The DP side now holds the QMP combo PHY. On the next resume,
qmp_combo_usb_init() skips the common block init, and
qmp_combo_usb_power_on() times out waiting for PHYSTATUS. The dwc3
resume fails with -110, and USB stays down until reboot.
On top of v7.3 I applied only the PHY power tracking from 08/20, the
power-off on the link clock failure from this patch, and a backport of
1bda647ce61b ("drm/msm/dp: move link-level teardown from
display_disable to display_unprepare") from msm-next. Then the same
unplug during s2idle crashed the SoC:
[drm:msm_dp_ctrl_link_train_1_2] *ERROR* link training #1 on phy 0 failed. ret=-110
...
[drm:msm_dp_display_atomic_enable] *ERROR* DP display prepare failed, rc=-104
[drm:dpu_encoder_phys_vid_wait_for_commit_done:583] [dpu error]vblank timeout: a0820302
[drm:dpu_encoder_phys_vid_disable] *ERROR* wait disable failed: id:37 intf:0 ret:-110
The device then reset into its crash dump mode. It crashed the same way
once more, after a failed link training during repeated VT switches
with the monitor attached. There the log went on 10 ms later with:
qcom_q6v5_pas d00000.remoteproc: fatal error received: sys_m_smsm.c:503:TZ force stop
Without these changes I saw the same failed enable and "wait disable
failed" three times, with no crash.
My guess is that the DP PHY, which clocks the DPU video interface, is
now turned off while that interface is still enabled. I have not
confirmed it. So I can't give a Tested-by. The PHY leak is still open
here.
Thanks,
Joonhoe Kim
More information about the linux-amlogic
mailing list