From c60d3d5989dd44ee522b94b75f0b6005dbe6f1cb Mon Sep 17 00:00:00 2001 From: Xiaowen Wu Date: Mon, 27 Jul 2020 22:18:59 -0400 Subject: [PATCH] disp: msm: dp: fix dp-mst stream double disabled issue There is a corner case when dp-mst stream is disabled twice: 1. stream 1 is enabled 2. cable plugged out, stream 1 is disabled by kernel 3. cable plugged in, enable stream 0 first 4. disable stream 1 Stream 1 is double disabled and will cause hw crash. This change will add the check and skip stream_off if already disabled. Change-Id: Icd1e815a1ed14cd4e784924f3db19b98eb06d571 Signed-off-by: Xiaowen Wu Signed-off-by: Sankeerth Billakanti --- msm/dp/dp_display.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index a07efd5e44..a568fee8bd 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -1257,6 +1257,12 @@ static void dp_display_stream_disable(struct dp_display_private *dp, return; } + if (dp_panel->stream_id == DP_STREAM_MAX || + !dp->active_panels[dp_panel->stream_id]) { + DP_ERR("panel is already disabled\n"); + return; + } + DP_DEBUG("stream_id=%d, active_stream_cnt=%d\n", dp_panel->stream_id, dp->active_stream_cnt);