aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/display
diff options
context:
space:
mode:
authorImre Deak <[email protected]>2025-04-01 10:38:45 +0000
committerImre Deak <[email protected]>2025-04-03 14:03:01 +0000
commitaea007741b951df05f901b2d4890df2e710d134b (patch)
tree2e2e99f33c906360e28256ad65e72c5c1f5c1b99 /drivers/gpu/drm/display
parentdrm/mode_config: Make drm_mode_config.(max|min)_(width|height) unsigned (diff)
downloadkernel-aea007741b951df05f901b2d4890df2e710d134b.tar.gz
kernel-aea007741b951df05f901b2d4890df2e710d134b.zip
drm/dp_mst: Fix GUID DPCD write to non-root MST branch devices
The return value on success of drm_dp_send_dpcd_write() called for non-root MST branch devices from drm_dp_check_mstb_guid() is the number of bytes transferred. Atm this return value (in case of a complete read) will be regarded incorrectly as an error by the caller of drm_dp_check_mstb_guid(). Fix this by converting the return value for a complete read to the expected success code (0) and for a partial read to a failure code (-EPROTO). Fixes: 2554da0de3e8 ("drm/display: dp-mst-topology: use new DCPD access helpers") Cc: Dmitry Baryshkov <[email protected]> Cc: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/display')
-rw-r--r--drivers/gpu/drm/display/drm_dp_mst_topology.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index e8716e73480b..8c312c1f1724 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -2200,6 +2200,8 @@ static int drm_dp_check_mstb_guid(struct drm_dp_mst_branch *mstb, guid_t *guid)
ret = drm_dp_send_dpcd_write(mstb->mgr,
mstb->port_parent,
DP_GUID, sizeof(buf), buf);
+ if (ret >= 0)
+ ret = ret == sizeof(buf) ? 0 : -EPROTO;
} else {
ret = drm_dp_dpcd_write_data(mstb->mgr->aux,
DP_GUID, buf, sizeof(buf));