Repository navigation
Fix MST suspend/resume case - #1619
Open
YongxingMou wants to merge 13 commits into
Open
YongxingMou wants to merge 13 commits into
YongxingMou wants to merge 13 commits into
Conversation
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>
Author
|
hotfix change yet, not merge it. |
Test resultsWorkflow run: 47066435715 attempt 1 Known failures configured: 0
Test Matrix
Failure summaryUnexpected failures
Result: blocked because unexpected failures were found. |
LAVA Failed Case Triage SummaryPR: #1619 Job 308301 | SoC glymur-qli-crdLAVA job: https://lava-oss.qualcomm.com/scheduler/job/308301 Failed test cases in LAVA job 308301 (SoC: glymur-qli-crd).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
fixup!commits): fixes to MST connector creation, stream atomic handling, MST enablement and the atomic check/commit path. To be squashed with--autosquashbefore upstreaming.Unexpected DP AUX IRQ 0x01000000 when not busyerror. A warning is printed only when the link is active.