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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D5CDC761A6 for ; Sat, 1 Apr 2023 01:42:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FE1C10E4F6; Sat, 1 Apr 2023 01:42:33 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id A7E1E10F360; Sat, 1 Apr 2023 01:42:30 +0000 (UTC) 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 D7F37B83303; Sat, 1 Apr 2023 01:42:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D9BC433D2; Sat, 1 Apr 2023 01:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680313347; bh=RvE78KytFAoRhZX6ykIgr1P/kHs/4e9J1365WZ43r7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FeYR4ayCQxmqL1/fn+jKVO/QaM2WfrGqUWJ/bGgq3hz0XUtDrp7mzWyzjxNmWvMj8 746iPoVROSD+vG542gkCJsNgWzwh4fD9VAmWJgzz6nPsVeZOBppTqlLyMVjTTfrWyD WUxhAKHRS8G7OVqLk18wLbwQMZZ4vWJ68BdU1iDv/9shPKzab1Y7L2HivHElxNgXt4 w/NYQJyJGxA5m+elq9fGyrZ5gCfmGjm+/C4yCkUhVK0x9H1Vhhn1ErVLJlZyJ1vpfH iowzkPCI6IcQPkuCBvO01srWjrIZLNPGSBzTNwigFD2OEhnTJQ4RD5BIAAKgroQkeJ bn5qWTCJ0WCbA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.2 22/25] drm/amdgpu: add mes resume when do gfx post soft reset Date: Fri, 31 Mar 2023 21:41:20 -0400 Message-Id: <20230401014126.3356410-22-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230401014126.3356410-1-sashal@kernel.org> References: <20230401014126.3356410-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , tim.huang@amd.com, Tong Liu01 , yifan1.zhang@amd.com, kenneth.feng@amd.com, dri-devel@lists.freedesktop.org, Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, mario.limonciello@amd.com, Alex Deucher , Likun.Gao@amd.com, evan.quan@amd.com, christian.koenig@amd.com, Hawking.Zhang@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tong Liu01 [ Upstream commit 4eb0b49a0ad3e004a6a65b84efe37bc7e66d560f ] [why] when gfx do soft reset, mes will also do reset, if mes is not resumed when do recover from soft reset, mes is unable to respond in later sequence [how] resume mes when do gfx post soft reset Signed-off-by: Tong Liu01 Acked-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 66eb102cd88fb..c748d92cec8e7 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -4625,6 +4625,14 @@ static bool gfx_v11_0_check_soft_reset(void *handle) return false; } +static int gfx_v11_0_post_soft_reset(void *handle) +{ + /** + * GFX soft reset will impact MES, need resume MES when do GFX soft reset + */ + return amdgpu_mes_resume((struct amdgpu_device *)handle); +} + static uint64_t gfx_v11_0_get_gpu_clock_counter(struct amdgpu_device *adev) { uint64_t clock; @@ -6096,6 +6104,7 @@ static const struct amd_ip_funcs gfx_v11_0_ip_funcs = { .wait_for_idle = gfx_v11_0_wait_for_idle, .soft_reset = gfx_v11_0_soft_reset, .check_soft_reset = gfx_v11_0_check_soft_reset, + .post_soft_reset = gfx_v11_0_post_soft_reset, .set_clockgating_state = gfx_v11_0_set_clockgating_state, .set_powergating_state = gfx_v11_0_set_powergating_state, .get_clockgating_state = gfx_v11_0_get_clockgating_state, -- 2.39.2