drm/amd/display: Add MST debug message when link detection fails
authorAlex Hung <alex.hung@amd.com>
Fri, 12 Jul 2024 15:39:13 +0000 (09:39 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:37:07 +0000 (17:37 -0400)
[WHY & HOW]
dc_link_detect returns a boolean value which can be used to print debug
messages when it fails.

This fixes 1 CHECKED_RETURN issue reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

index 62cb59f00929b8273a604fce96118b1f91a29ffa..db56b0aa545454a6d92d378b04c0c1d061e9170f 100644 (file)
@@ -3804,9 +3804,12 @@ static int trigger_hpd_mst_set(void *data, u64 val)
                        if (aconnector->dc_link->type == dc_connection_mst_branch &&
                            aconnector->mst_mgr.aux) {
                                mutex_lock(&adev->dm.dc_lock);
-                               dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
+                               ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
                                mutex_unlock(&adev->dm.dc_lock);
 
+                               if (!ret)
+                                       DRM_ERROR("DM_MST: Failed to detect dc link!");
+
                                ret = drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true);
                                if (ret < 0)
                                        DRM_ERROR("DM_MST: Failed to set the device into MST mode!");