Skip to content

drm/msm/dp: fix NULL pointer deref in msm_dp_snapshot() for unmapped MST streams - #1050

Open
YongxingMou wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
YongxingMou:for-dp-snap-fix
Open

drm/msm/dp: fix NULL pointer deref in msm_dp_snapshot() for unmapped MST streams#1050
YongxingMou wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
YongxingMou:for-dp-snap-fix

Conversation

@YongxingMou

Copy link
Copy Markdown

msm_dp_snapshot() unconditionally dumped pixel_base[0..3]/mst2link_base/
mst3link_base. On single-stream platforms, or when DT doesn't declare
the optional p1/p2/p3 pixel or mst2link/mst3link regions, these stay
NULL, so triggering a snapshot (e.g. DP hang/devcoredump) caused a NULL
pointer dereference.

Fix by explicitly setting pixel_base[i]/mst2link_base/mst3link_base to
NULL when the DT resource is legitimately absent (-EINVAL), and skip
dumping a block in msm_dp_snapshot() when its base is NULL or the
stream's pixel clock isn't enabled (via new msm_dp_ctrl_stream_clks_on()).

CR-Fixed: 4589764

…MST"

This reverts commit cd58926.

This is reverted because a newer version of this patch is being introduced.
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

Yongxing Mou added 3 commits September 7, 2026 18:49
…gister blocks"

This reverts commit c8a9835.

This is reverted because a newer version of this patch is being introduced.
…locks

Add support for additional pixel register blocks (p1, p2, p3) to enable
4-stream MST pixel clocks. Introduce the helper functions msm_dp_read_pn
and msm_dp_write_pn for pixel register programming. All pixel clocks
share the same register layout but use different base addresses.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260831-msm-dp-mst-v6-5-c91d35d6fb9e@oss.qualcomm.com/
DisplayPort MST uses multiple stream-specific register spaces. Streams
0 and 1 share the primary link register block with different register
offsets, while streams 2 and 3 use dedicated MST link register blocks.

Add stream-aware register access helpers that translate stream-specific
register offsets and route accesses to the appropriate register space
based on the stream id.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260831-msm-dp-mst-v6-7-c91d35d6fb9e@oss.qualcomm.com/
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

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.

1 participant