From patchwork Fri Nov 18 07:48:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenneng Li X-Patchwork-Id: 13047802 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 36AD6C433FE for ; Fri, 18 Nov 2022 07:53:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A09510E6E0; Fri, 18 Nov 2022 07:53:56 +0000 (UTC) X-Greylist: delayed 304 seconds by postgrey-1.36 at gabe; Fri, 18 Nov 2022 07:53:51 UTC Received: from mailgw.kylinos.cn (unknown [124.126.103.232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 619B610E6E0; Fri, 18 Nov 2022 07:53:51 +0000 (UTC) X-UUID: e2b1022d870444de904bc7758601fd3f-20221118 X-CPASD-INFO: 2196396c782b4b0f9f54fe0c44f3a206@e4FzVmBrZJNjWHSug6V7oFmXZWSWkVC ydm6GY49iXFaVhH5xTV5uYFV9fWtVYV9dYVR6eGxQYmBgZFJ4i3-XblBgXoZgUZB3gXNzVmNnZg== X-CLOUD-ID: 2196396c782b4b0f9f54fe0c44f3a206 X-CPASD-SUMMARY: SIP:-1, APTIP:-2.0, KEY:0.0, FROMBLOCK:1, OB:0.0, URL:-5, TVAL:196. 0, ESV:0.0, ECOM:-5.0, ML:0.0, FD:0.0, CUTS:123.0, IP:-2.0, MAL:-5.0, PHF:-5.0, PHC:-5 .0, SPF:4.0, EDMS:-5, IPLABEL:4480.0, FROMTO:0, AD:0, FFOB:0.0, CFOB:0.0, SPC:0, SIG:- 5, AUF:6, DUF:8732, ACD:145, DCD:145, SL:0, EISP:0, AG:0, CFC:0.421, CFSR:0.046, UAT:0, RAF:0, IMG:-5.0, DFA:0, DTA:0, IBL:-2.0, ADI:-5, SBL:0, REDM:0, REIP:0, ESB:0, ATTNUM:0 ,EAF:0,CID:-5.0,VERSION:2.3.17 X-CPASD-ID: e2b1022d870444de904bc7758601fd3f-20221118 X-CPASD-BLOCK: 1000 X-CPASD-STAGE: 1 X-UUID: e2b1022d870444de904bc7758601fd3f-20221118 X-User: lizhenneng@kylinos.cn Received: from localhost.localdomain [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1969169403; Fri, 18 Nov 2022 15:49:02 +0800 From: Zhenneng Li To: Alex Deucher Subject: [PATCH] drm/amdgpu: add mb for si Date: Fri, 18 Nov 2022 15:48:10 +0800 Message-Id: <20221118074810.380368-1-lizhenneng@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Zhenneng Li , dri-devel@lists.freedesktop.org, =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" During reboot test on arm64 platform, it may failure on boot, so add this mb in smc. The error message are as follows: [ 6.996395][ 7] [ T295] [drm:amdgpu_device_ip_late_init [amdgpu]] *ERROR* late_init of IP block failed -22 [ 7.006919][ 7] [ T295] amdgpu 0000:04:00.0: amdgpu_device_ip_late_init failed [ 7.014224][ 7] [ T295] amdgpu 0000:04:00.0: Fatal error during GPU init Signed-off-by: Zhenneng Li --- drivers/gpu/drm/amd/pm/legacy-dpm/si_smc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_smc.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_smc.c index 8f994ffa9cd1..c7656f22278d 100644 --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_smc.c +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_smc.c @@ -155,6 +155,8 @@ bool amdgpu_si_is_smc_running(struct amdgpu_device *adev) u32 rst = RREG32_SMC(SMC_SYSCON_RESET_CNTL); u32 clk = RREG32_SMC(SMC_SYSCON_CLOCK_CNTL_0); + mb(); + if (!(rst & RST_REG) && !(clk & CK_DISABLE)) return true;