Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp708605pxv; Thu, 15 Jul 2021 14:05:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqQvh+pyY6pCr8bHDfmUWRBdu4E40t1eQ79YLA7wAJUDITMRwD04J5ayNfu5tPaR8MrMgN X-Received: by 2002:a17:907:3c16:: with SMTP id gh22mr7751923ejc.158.1626383104705; Thu, 15 Jul 2021 14:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383104; cv=none; d=google.com; s=arc-20160816; b=Hv1YRLSytHesBG4bZr5KWaZUtkWaDSdvVqXZfyeBuLVm2KqBqDCNEJWquxmQuo4YJK CG/b4xac+e36qXV+KE8pceD708k4eZJmgVgmEqRVYaHZO3UxR9ReETSV3DpwlWgLs41E zH7RZ7t+yTKTOIMfRSXVhaM+xP9kJmkFnuZUf1b6gMcr8fb2NA9n54p5wSAVXwMXLEm6 Xv91GJpFVUvdijvTmIN6nWAD454TVC0TsophhsMC9bylmv88vpowa3nmh8hMqhnN8r9Y cnYB5dDSwlQjQeW8pO1AWExRrlv/KyfpYAsFXNVEyoAfotLPQxkPMRnWI2piYiwhcRTM uY8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B3z29N8uk7OuBcFtblBLupYFWeYwy+D2gEs8o/8ljW4=; b=YpZLTCXWXrrmeHdf0X59ikj0+CpriVt3HmEPUL807Ez6pC/QddmDS+y0B6UPP3hEd/ h+u2D7LuaQBcbyWkpkwhvOgdz3Vd81+CCIwqXsvNaYfvwkXA5xF00hl+IfC6plapx5ig yFYh0fd+Ml5DELnM9I+kcGI+qwtAFA8MDfYcA6eSkyAmNSD1NmIXFOAORS/bs0vyz2mX uHzVEfVJhzSNGBUxcNR1GLhReS7HlCG89T3W/enBhpQv+2MGtFBj1Vm4lUVEwypUj2UL w6A9lT62fjeUKQZ9j0EYbERFRcDH4IKcQer3BMhT2LOGAChjpUy4Sr36z+xvpKLGwYwM R8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wQQxbljL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si9928652ejy.297.2021.07.15.14.04.41; Thu, 15 Jul 2021 14:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wQQxbljL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244840AbhGOTPU (ORCPT + 99 others); Thu, 15 Jul 2021 15:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243230AbhGOTBq (ORCPT ); Thu, 15 Jul 2021 15:01:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 989E2613D0; Thu, 15 Jul 2021 18:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375504; bh=7Qs1r0aFeYfdkTLkkZFBrLjt20yzUE/Pmdvn8MSeMxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wQQxbljLjx+y2aLU9kVFZvWiORlTxpV+vos08mkl7+qyBjsBCtq15//qKinBLjxZ8 zXP/RbRjyypIbOOGJwT0aUtt21yFKB0xHD7T+zgT3ckapr2miVVq5OpdGrYreKgiB/ le4pxtxomCgq9iOvBuU+rVrYZty8xDijY3w+GPSw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Stempen , Wenjing Liu , Stylon Wang , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.12 072/242] drm/amd/display: Release MST resources on switch from MST to SST Date: Thu, 15 Jul 2021 20:37:14 +0200 Message-Id: <20210715182605.689863923@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Stempen [ Upstream commit 3f8518b60c10aa96f3efa38a967a0b4eb9211ac0 ] [why] When OS overrides training link training parameters for MST device to SST mode, MST resources are not released and leak of the resource may result crash and incorrect MST discovery during following hot plugs. [how] Retaining sink object to be reused by SST link and releasing MST resources. Signed-off-by: Vladimir Stempen Reviewed-by: Wenjing Liu Acked-by: Stylon Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index b85f67341a9a..c957d7d055ba 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -1726,6 +1726,8 @@ static void set_dp_mst_mode(struct dc_link *link, bool mst_enable) link->type = dc_connection_single; link->local_sink = link->remote_sinks[0]; link->local_sink->sink_signal = SIGNAL_TYPE_DISPLAY_PORT; + dc_sink_retain(link->local_sink); + dm_helpers_dp_mst_stop_top_mgr(link->ctx, link); } else if (mst_enable == true && link->type == dc_connection_single && link->remote_sinks[0] != NULL) { -- 2.30.2