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 A498DC77B73 for ; Mon, 1 May 2023 03:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232890AbjEADJu (ORCPT ); Sun, 30 Apr 2023 23:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbjEADFq (ORCPT ); Sun, 30 Apr 2023 23:05:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C67A52710; Sun, 30 Apr 2023 20:02:35 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B873A6170A; Mon, 1 May 2023 03:02:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BDBEC433EF; Mon, 1 May 2023 03:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682910155; bh=Do8RwKlCy6GwAleJgok+hQDUEKiHkL7cY1TFGe0+u7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=niQGmsdBWQEmmSxu9kbHWl2WK1ICby9DuCKr9O+N1Iy62uHE2sA0uhbl2XN2j8Xsu KOacWWV8X1RWyDqgNWasTX416n76LpV93Hi73D+sDb/D5xeZYoWp61g3zUaog2zy4x g94PHPanFYgFGXzJISftyB5lqG8Y9OVZ5WcbNHDCfB51NDt4WGM2NBDwyNNLsuVGcB CkozV0+2RHLBek11h91zcqqqDKWwlYO1mmWRTgYz6wyeogzcPcueRRVuZ7HPRYbGgG Z8HS3f1VeTRzrsU872T544kyFNn6ez5KbMlkFnj1TikKaWf/fSthifBsmJilqaohK7 pO44rJjHknpvw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ayush Gupta , Alvin Lee , Qingqing Zhuo , Daniel Wheeler , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Jun.Lei@amd.com, Max.Tseng@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.1 02/33] drm/amd/display: populate subvp cmd info only for the top pipe Date: Sun, 30 Apr 2023 23:01:56 -0400 Message-Id: <20230501030227.3254266-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501030227.3254266-1-sashal@kernel.org> References: <20230501030227.3254266-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ayush Gupta [ Upstream commit 9bb10b7aaec3b6278f9cc410c17dcaa129bbbbf0 ] [Why] System restart observed while changing the display resolution to 8k with extended mode. Sytem restart was caused by a page fault. [How] When the driver populates subvp info it did it for both the pipes using vblank which caused an outof bounds array access causing the page fault. added checks to allow the top pipe only to fix this issue. Co-authored-by: Ayush Gupta Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Ayush Gupta Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c index 0541e87e4f389..a461e9463534b 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c @@ -764,7 +764,8 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, !pipe->top_pipe && !pipe->prev_odm_pipe && pipe->stream->mall_stream_config.type == SUBVP_MAIN) { populate_subvp_cmd_pipe_info(dc, context, &cmd, pipe, cmd_pipe_index++); - } else if (pipe->plane_state && pipe->stream->mall_stream_config.type == SUBVP_NONE) { + } else if (pipe->plane_state && pipe->stream->mall_stream_config.type == SUBVP_NONE && + !pipe->top_pipe && !pipe->prev_odm_pipe) { // Don't need to check for ActiveDRAMClockChangeMargin < 0, not valid in cases where // we run through DML without calculating "natural" P-state support populate_subvp_cmd_vblank_pipe_info(dc, context, &cmd, pipe, cmd_pipe_index++); -- 2.39.2