From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD40C433F5 for ; Mon, 28 Feb 2022 18:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239613AbiB1SBk (ORCPT ); Mon, 28 Feb 2022 13:01:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240759AbiB1Rye (ORCPT ); Mon, 28 Feb 2022 12:54:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184B850E36; Mon, 28 Feb 2022 09:43:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BD561B815B8; Mon, 28 Feb 2022 17:43:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C601C340E7; Mon, 28 Feb 2022 17:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070181; bh=5dm7uLNDaDHkQMdjOmGzkqLJGVxRYhYtS1tosPEpBHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6Vxq0TXJzQC+FslWc2w4DVPa+kX+AnI9iav/P6dCFXNPgLaGkXCqYzJikpmyZP1n NaYmSH8gRTyCixnaENnY8HToAB0LiUgk+mz1VfypujnFkXUWoGCbSQWAxcK3c4bI56 Wk9eiD4Rjx4qs0rn/yx1ITPYkWuSNZzAfNwo6vkY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jimmy Kizito , Jasdeep Dhillon , Nicholas Kazlauskas , Daniel Wheeler , Alex Deucher Subject: [PATCH 5.16 016/164] drm/amd/display: Fix stream->link_enc unassigned during stream removal Date: Mon, 28 Feb 2022 18:22:58 +0100 Message-Id: <20220228172401.393934941@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@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: Nicholas Kazlauskas commit 3743e7f6fcb938b7d8b7967e6a9442805e269b3d upstream. [Why] Found when running igt@kms_atomic. Userspace attempts to do a TEST_COMMIT when 0 streams which calls dc_remove_stream_from_ctx. This in turn calls link_enc_unassign which ends up modifying stream->link = NULL directly, causing the global link_enc to be removed preventing further link activity and future link validation from passing. [How] We take care of link_enc unassignment at the start of link_enc_cfg_link_encs_assign so this call is no longer necessary. Fixes global state from being modified while unlocked. Reviewed-by: Jimmy Kizito Acked-by: Jasdeep Dhillon Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -1876,10 +1876,6 @@ enum dc_status dc_remove_stream_from_ctx dc->res_pool, del_pipe->stream_res.stream_enc, false); - /* Release link encoder from stream in new dc_state. */ - if (dc->res_pool->funcs->link_enc_unassign) - dc->res_pool->funcs->link_enc_unassign(new_ctx, del_pipe->stream); - #if defined(CONFIG_DRM_AMD_DC_DCN) if (is_dp_128b_132b_signal(del_pipe)) { update_hpo_dp_stream_engine_usage(