From: Eric Yang Date: Wed, 1 Nov 2017 19:43:47 +0000 (-0400) Subject: drm/amd/display: fix MST link training fail division by 0 X-Git-Tag: v4.15-rc1~56^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00f713c6dc657397ba37b42d7f6887f526c730c6;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: fix MST link training fail division by 0 When link training fail in MST case, we will divide by 0 when calculating avg_time_slots_per_mtp, so we cannot proceed. Signed-off-by: Eric Yang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index e70612eaf2576..0602610489d75 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -2318,9 +2318,11 @@ void core_link_enable_stream( /* Abort stream enable *unless* the failure was due to * DP link training - some DP monitors will recover and - * show the stream anyway. + * show the stream anyway. But MST displays can't proceed + * without link training. */ - if (status != DC_FAIL_DP_LINK_TRAINING) { + if (status != DC_FAIL_DP_LINK_TRAINING || + pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) { BREAK_TO_DEBUGGER(); return; }