Commit cbd6c1b1 authored by Cruise Hung's avatar Cruise Hung Committed by Alex Deucher

drm/amd/display: Fix DP MST sinks removal issue

[Why]
In USB4 DP tunneling, it's possible to have this scenario that
the path becomes unavailable and CM tears down the path a little bit late.
So, in this case, the HPD is high but fails to read any DPCD register.
That causes the link connection type to be set to sst.
And not all sinks are removed behind the MST branch.

[How]
Restore the link connection type if it fails to read DPCD register.

Cc: stable@vger.kernel.org
Cc: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarWenjing Liu <Wenjing.Liu@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarCruise Hung <Cruise.Hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 56574f89
...@@ -855,6 +855,7 @@ static bool detect_link_and_local_sink(struct dc_link *link, ...@@ -855,6 +855,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
struct dc_sink *prev_sink = NULL; struct dc_sink *prev_sink = NULL;
struct dpcd_caps prev_dpcd_caps; struct dpcd_caps prev_dpcd_caps;
enum dc_connection_type new_connection_type = dc_connection_none; enum dc_connection_type new_connection_type = dc_connection_none;
enum dc_connection_type pre_connection_type = link->type;
const uint32_t post_oui_delay = 30; // 30ms const uint32_t post_oui_delay = 30; // 30ms
DC_LOGGER_INIT(link->ctx->logger); DC_LOGGER_INIT(link->ctx->logger);
...@@ -957,6 +958,8 @@ static bool detect_link_and_local_sink(struct dc_link *link, ...@@ -957,6 +958,8 @@ static bool detect_link_and_local_sink(struct dc_link *link,
} }
if (!detect_dp(link, &sink_caps, reason)) { if (!detect_dp(link, &sink_caps, reason)) {
link->type = pre_connection_type;
if (prev_sink) if (prev_sink)
dc_sink_release(prev_sink); dc_sink_release(prev_sink);
return false; return false;
...@@ -1244,11 +1247,16 @@ bool link_detect(struct dc_link *link, enum dc_detect_reason reason) ...@@ -1244,11 +1247,16 @@ bool link_detect(struct dc_link *link, enum dc_detect_reason reason)
bool is_delegated_to_mst_top_mgr = false; bool is_delegated_to_mst_top_mgr = false;
enum dc_connection_type pre_link_type = link->type; enum dc_connection_type pre_link_type = link->type;
DC_LOGGER_INIT(link->ctx->logger);
is_local_sink_detect_success = detect_link_and_local_sink(link, reason); is_local_sink_detect_success = detect_link_and_local_sink(link, reason);
if (is_local_sink_detect_success && link->local_sink) if (is_local_sink_detect_success && link->local_sink)
verify_link_capability(link, link->local_sink, reason); verify_link_capability(link, link->local_sink, reason);
DC_LOG_DC("%s: link_index=%d is_local_sink_detect_success=%d pre_link_type=%d link_type=%d\n", __func__,
link->link_index, is_local_sink_detect_success, pre_link_type, link->type);
if (is_local_sink_detect_success && link->local_sink && if (is_local_sink_detect_success && link->local_sink &&
dc_is_dp_signal(link->local_sink->sink_signal) && dc_is_dp_signal(link->local_sink->sink_signal) &&
link->dpcd_caps.is_mst_capable) link->dpcd_caps.is_mst_capable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment