Skip to content

Fix MST suspend/resume case - #1619

Open
YongxingMou wants to merge 13 commits into
qualcomm-linux:qcom-7.3from
YongxingMou:mst-v9-test
Open

YongxingMou wants to merge 13 commits into
qualcomm-linux:qcom-7.3from
YongxingMou:mst-v9-test

Conversation

@YongxingMou

Copy link
Copy Markdown

Changes

  • Serialize SST enable against pending MST teardown: wait for the MST teardown to finish before enabling SST.
  • Fixups for the MST v9 series (10 fixup! commits): fixes to MST connector creation, stream atomic handling, MST enablement and the atomic check/commit path. To be squashed with --autosquash before upstreaming.
  • MST topology suspend/resume: suspend and resume the MST topology manager across system sleep. If the topology is gone after resume, fall back and drop MST.
  • Sync with MST-v9-1118-7.4-rc1: bring the local MST code in line with the v9 1118 version (local test).
  • PLL_UNLOCK_DET: handle the PHY PLL unlock interrupt in the DP controller instead of passing it to the AUX ISR. This removes the spurious Unexpected DP AUX IRQ 0x01000000 when not busy error. A warning is printed only when the link is active.

Yongxing Mou and others added 13 commits December 3, 2026 16:00
When the MST manager state is cleared on unplug, ctrl->mst_mode and
msm_dp->mst_active can briefly disagree while the previous MST
session's streams are still being torn down (active_stream_mask and
link_ready have not been cleared yet). If a new SST sink is plugged
into the same physical connector before that teardown completes, its
enable commit can race the still-in-flight MST disable commit and
observe a stale link_ready, skipping link retraining for the new sink.

MST uses fake encoders for its virtual connectors, so the generic
atomic helper has no way to serialize a modeset on the physical
connector against pending commits on its MST topology - they never
share an encoder. drm_dp_mst_root_conn_atomic_check() exists precisely
to close this gap: it pulls the MST topology state into the physical
connector's atomic state when the connector is about to modeset, so
drm_dp_mst_atomic_wait_for_dependencies() will block the new commit on
the prior MST commit's completion.

msm's physical DP connector is created via drm_bridge_connector_init(),
so it has no driver-owned drm_connector_helper_funcs to hook the check
into directly. Call it from the bridge's atomic_check instead, which
mode_fixup() still invokes whenever the connector is gaining a CRTC
(which is the case that matters here: a new sink enabling on a
connector that just dropped out of MST). Non-MST-capable connectors
(eDP, single-stream ports) see msm_dp_mst_get_mgr() return NULL and
take the existing no-op path.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
Wrap the drm_dp_mst_atomic_*() calls in msm_dp_mst_atomic_*() helpers (dp_mst_drm.c) with no-op stubs in msm_drv.h for !CONFIG_DRM_MSM_DP, so msm_atomic.c links with CONFIG_DRM_MSM_KMS=y and CONFIG_DRM_MSM_DP=n.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Allocate the payload based on crtc_state->enable instead of ->active, as
i915 and nouveau do. drm_dp_atomic_release_time_slots() expects a payload
for every CRTC that is enabled, so a CRTC that was committed with
enable=1, active=0 and is unbound later hit WARN_ON(!payload) and -EINVAL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fixup! drm/msm/dp: introduce dp_mst_drm module

Let the DPU decide how many MST streams a DP controller gets, based on the INTFs its catalog provides for it, and make the MST manager the single owner of that number.

The DT may describe more streams than the DPU can drive (e.g. SC8180X, where the second-stream INTF is shared by DP0/DP1 and not modelled in the catalog, so it cannot be matched to any controller). Creating a per-stream encoder for such a stream fails and takes down the whole KMS init.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fixup! drm/msm/dp: enable MST on capable sinks

Ask the MST manager, not the DT clock count, whether MST is in use.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…le sink is present

fixup! drm/msm/dp: mark the SST bridge disconnected when an MST-capable sink is present

Ask the MST manager, not the DT clock count, whether MST is in use.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When the sink is in MST mode, mst_active stays true for the whole
session, so post_disable never called msm_dp_display_unprepare(). The
link, the PHY and the runtime PM reference taken in prepare_link() were
only released on unplug, which does not run on suspend, leaving the
link up and leaking the reference.

msm_dp_display_unprepare() already bails out while link_ready is false
or any stream is still active, so call it unconditionally.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
With an MST sink the branch device can keep sending sideband messages
(e.g. CSN) after the last stream is disabled, and reading them needs
AUX. Exiting the PHY in msm_dp_display_unprepare() leaves AUX dead
until the next prepare_link(), so keep the PHY alive (re-init it) while
mst_active is set, the same as for the sink_count == 0 case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Within one atomic commit all disables run before the enables. When a
connector moves to another CRTC (e.g. the fbdev client reassigns CRTCs
after another sink on the hub is unplugged), the last stream on the link
is disabled first and then re-enabled later in the same commit. Since
the stream mask is empty at that point, post_disable tore the link down
(link off, PHY re-init, runtime PM put) only for the following enable to
power it up and train it again.

Keep the link if the new state still has an active CRTC driving one of
this manager's MST connectors. Connectors that are not part of the
commit keep their stream enabled, so the stream mask already protects
them and only the connectors in the commit need to be checked. CRTCs
that are enabled but not active do not need the link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MST topology manager is never told about system sleep. Its work
items keep running while the controller is powered down, the branch
device keeps UP_REQ_EN set and may send sideband messages that nobody
can read, and on resume the restored streams are allocated on a
topology that may no longer exist: if the branch lost power it comes
back with MST disabled, or it may have been replaced by a different
device.

Suspend the topology manager from the DP device's system sleep
callbacks and resume it before the atomic state is restored. The DRM
device's .prepare already disabled all streams through
drm_mode_config_helper_suspend(), so the link is down by then, and its
.complete restores the state only after every device has run its
.resume. This matches the order used by i915.

While MST is active the PHY is kept initialized after the last stream
is disabled so that AUX can still read sideband messages. Nothing reads
them while the manager is suspended, so release the PHY on suspend and
initialize it again on resume, before the manager accesses the DPCD.
If the topology cannot be resumed, drop MST under plugged_lock, as on
unplug, and send a hotplug event.

Based on a patch by Joonhoe Kim <26rote@gmail.com>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port remaining MST differences from the v9 backup tree: dp_mst_drm.c as in v9,
mgr_state error handling, panel hw_revision, and pixel clock teardown on
mst enable failure.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DP_INTERRUPT_STATUS is the "DP AUX/PLL related interrupt status"
register: besides the AUX/I2C completion and error sources it also
carries PLL_UNLOCK_DET_INT (bit 24), which the register description
defines as "PLL in DP PHY has unlocked", i.e. the PHY PLL that sources
the link clock. It is not an AUX transfer event.

The driver enables all sources in this register, but msm_dp_ctrl_isr()
hands the whole status word to msm_dp_aux_isr(). The AUX handler has
no case for the PLL bit, so when no transfer is in flight it reports:

  [drm:msm_dp_aux_isr [msm]] *ERROR* Unexpected DP AUX IRQ 0x01000000 when not busy

This is the error already noted in commit b20566c ("drm/msm/dp:
Clean up handling of DP AUX interrupts"), which was left in place in
the hope that someone would track down where it comes from. It is
raised whenever the PHY is re-initialised while the link is down
(e.g. msm_dp_ctrl_reinit_phy() after msm_dp_ctrl_off_link()): the PLL
is not programmed at that point, so the lock detector reports an
unlock shortly after phy_init(). That is expected and harmless.

Handle PLL_UNLOCK_DET in the controller, which owns the PHY and link
clocks, and pass only the remaining AUX bits to msm_dp_aux_isr(). An
unlock while the link clocks are running does indicate a real link
clock problem, so warn (rate limited) in that case and only emit a
debug message when the link is off.

Fixes: b20566c ("drm/msm/dp: Clean up handling of DP AUX interrupts")
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YongxingMou

Copy link
Copy Markdown
Author

hotfix change yet, not merge it.

@qcomlnxci

Copy link
Copy Markdown

Test results

Workflow run: 47066435715 attempt 1

Known failures configured: 0

Target Pass Non-pass Total
kbdev-glymur-crd-multimedia 30 8 38

Test Matrix

Test Case kbdev-glymur-crd-multimedia
LAVA result ✅ Results
Audio_Card_Registration ✅ Pass
BT_FW_KMD_Service ✅ Pass
BT_ON_OFF ✅ Pass
BT_SCAN ✅ Pass
CPUFreq_Validation ✅ Pass
CPU_affinity ✅ Pass
DSP_AudioPD ⚠️ skip
Ethernet_Basic_Validation ⚠️ skip
Ethernet_Inventory_Validation ⚠️ skip
FastRPC_Runtime_Validation ❌ Fail
Freq_Scaling ✅ Pass
GIC ✅ Pass
IPA ✅ Pass
Interrupts ✅ Pass
KVM_Driver ✅ Pass
KVM_EL2_DTB ✅ Pass
KVM_Infra ✅ Pass
KVM_Runtime_Validation ✅ Pass
OpenCV ✅ Pass
PCIe ✅ Pass
Probe_Failure_Check ❌ Fail
RMNET ✅ Pass
UFS_Validation ⚠️ skip
USBHost ✅ Pass
WiFi_Firmware_Driver ✅ Pass
WiFi_OnOff ✅ Pass
adsp_remoteproc ✅ Pass
cdsp_remoteproc ✅ Pass
gpdsp_remoteproc ⚠️ skip
hotplug ✅ Pass
irq ✅ Pass
pinctrl ✅ Pass
qcom_hwrng ✅ Pass
remoteproc ❌ Fail
rngtest ✅ Pass
shmbridge ✅ Pass
watchdog ✅ Pass
wpss_remoteproc ✅ Pass
Failure summary

Unexpected failures

  • kbdev-glymur-crd-multimedia: gpdsp_remoteproc => skip.
  • kbdev-glymur-crd-multimedia: remoteproc => fail.
  • kbdev-glymur-crd-multimedia: Probe_Failure_Check => fail.
  • kbdev-glymur-crd-multimedia: UFS_Validation => skip.
  • kbdev-glymur-crd-multimedia: Ethernet_Inventory_Validation => skip.
  • kbdev-glymur-crd-multimedia: Ethernet_Basic_Validation => skip.
  • kbdev-glymur-crd-multimedia: FastRPC_Runtime_Validation => fail.
  • kbdev-glymur-crd-multimedia: DSP_AudioPD => skip.

Result: blocked because unexpected failures were found.

@qlijarvis

Copy link
Copy Markdown

LAVA Failed Case Triage Summary

PR: #1619

Job 308301 | SoC glymur-qli-crd

LAVA job: https://lava-oss.qualcomm.com/scheduler/job/308301

Failed test cases in LAVA job 308301 (SoC: glymur-qli-crd).

  Case 1: ** remoteproc
  1. Failed case: ** remoteproc
  2. Root cause: ** Test harness incorrectly flags a non-fatal driver warning as a failure; qcom_q6v5_pas driver reports -EINVAL when attempting to read optional "shutdown_state" DT property during soccp attach, but the attach completes successfully and all remoteprocs reach valid operational states (soccp=attached, adsp=running, cdsp=running).
  3. Possible fix: Update the remoteproc test harness dmesg error filter to exclude this known non-fatal warning pattern, or add the optional "shutdown_state" property to the soccp device tree node if the platform requires it for proper shutdown sequencing.
  4. Detail analysis attachment: failed_case_job308301_1_detailed.md
  Case 2: Probe_Failure_Check
  1. Failed case: Probe_Failure_Check
  2. Root cause: Could not be determined confidently from available logs.
  3. Possible fix: Suppress this known benign probe warning in Probe_Failure_Check test configuration for glymur-qli-crd, as it does not indicate a functional regression (Audio_Card_Registration validates actual audio functionality and passes). If upstream fix is desired, investigate SoundWire peripheral enumeration timing and wsa_macro register access sequencing in sound/soc/codecs/wsa-macro.c for glymur (X1E80100) platform.
  4. Detail analysis attachment: failed_case_job308301_2_detailed.md
  Case 3: FastRPC_Runtime_Validation
  1. Failed case: FastRPC_Runtime_Validation
  2. Root cause: Pre-existing non-fatal remoteproc driver error during ADSP initialization (qcom_q6v5_pas d00000.remoteproc: failed to get shutdown_state: -22) detected by the test's dmesg scanner; the error occurs at boot time (7.72s) before any PR changes are applied, ADSP/CDSP remoteprocs reach running state successfully, and all FastRPC endpoints are accessible.
  3. Possible fix: This is a false positive test failure — the PR (DRM/MSM DisplayPort MST changes) does not touch remoteproc code and cannot cause this error; suppress this known benign remoteproc initialization warning in the FastRPC test's dmesg filter, or fix the underlying qcom_q6v5_pas driver to handle missing shutdown_state property gracefully without logging an error.
  4. Detail analysis attachment: failed_case_job308301_3_detailed.md

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.

3 participants