Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Prevent dpcd reads with passive dongles

[why]
During hotplug, a DP port may be connected to the sink through
passive adapter which does not support DPCD reads. Issuing reads
without checking for this condition will result in errors

[how]
Ensure the link is in aux_mode before initiating operation that result
in a DPCD read.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Aurabindo Pillai and committed by
Alex Deucher
7b353e41 65d68369

+11 -6
+11 -6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 2012 2012 dc_sink_retain(aconnector->dc_sink); 2013 2013 if (sink->dc_edid.length == 0) { 2014 2014 aconnector->edid = NULL; 2015 - drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux); 2015 + if (aconnector->dc_link->aux_mode) { 2016 + drm_dp_cec_unset_edid( 2017 + &aconnector->dm_dp_aux.aux); 2018 + } 2016 2019 } else { 2017 2020 aconnector->edid = 2018 - (struct edid *) sink->dc_edid.raw_edid; 2019 - 2021 + (struct edid *)sink->dc_edid.raw_edid; 2020 2022 2021 2023 drm_connector_update_edid_property(connector, 2022 - aconnector->edid); 2023 - drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, 2024 - aconnector->edid); 2024 + aconnector->edid); 2025 + 2026 + if (aconnector->dc_link->aux_mode) 2027 + drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, 2028 + aconnector->edid); 2025 2029 } 2030 + 2026 2031 amdgpu_dm_update_freesync_caps(connector, aconnector->edid); 2027 2032 update_connector_ext_caps(aconnector); 2028 2033 } else {