drm/dp_mst: Fix GUID DPCD write to non-root MST branch devices
authorImre Deak <imre.deak@intel.com>
Tue, 1 Apr 2025 10:38:45 +0000 (13:38 +0300)
committerImre Deak <imre.deak@intel.com>
Thu, 3 Apr 2025 14:03:01 +0000 (17:03 +0300)
commitaea007741b951df05f901b2d4890df2e710d134b
tree2e2e99f33c906360e28256ad65e72c5c1f5c1b99
parent8abaa80b403e1fc40877eb9b339ae0ad07e8968f
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 <dmitry.baryshkov@linaro.org>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250401103846.686408-1-imre.deak@intel.com
drivers/gpu/drm/display/drm_dp_mst_topology.c