Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp495137pxf; Thu, 11 Mar 2021 08:14:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV0F2qs4ta+/JL29aDQ84FwiNssQUuKpGKXLWtz8zm9QAAVT7Mx8MnnRXSqeDNSQrE4ITI X-Received: by 2002:a17:907:9862:: with SMTP id ko2mr3734917ejc.222.1615479261541; Thu, 11 Mar 2021 08:14:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615479261; cv=none; d=google.com; s=arc-20160816; b=UzPCX3dvNvHWfaITLh21ZpBl0asqTmkKvCsYj1tG6ntwx9mEAqdoFBia7FFwosOoya Yu+krmONBKMwuE+cS0iyps0zvjySeqQEejoiwXov52Mkrqy5ktXsq3RQ/Md/MdoFazH0 P90kM8vrHr2fev7FWcsPMvcueAeSvG/aWaYp9KV+/ZBEteZbXvVcpBezNlPV7A8fGFy3 7npfr4cHDO3OxYMkI8tK5INjkTpIcJfV/OTNgR/ywHTE3RkYCMfG+kJjl/GzpLUt0iNI +ieLVpyM+I9T0bAo7TkqtjjA7TQmo9FQr4IzS8CNEQlEwnA92PuwiMEv+gb1WBsv4e7q OXuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dsVj1tbMCQQY03XaaBJkVTgd3uxndiFFvZTsqGrWJds=; b=nvlQhoZIVM16xLlRIazGifWfdxnQfC+BVPpmflo6CNSKyM6s/AEWSbZMw+7RtwnrbV oAUj45y6Pl99M2u68MUi3/QhQ8u9vRPcvq+XB6hehb53e0RliJQwFIto+LVVjn07FFco y+xZzjx4kL/R0KRvoP21LideAsJ0G8xIczgSuT6D4ZDcAJP6Ocyh8vmiCH0sd6NKJJLj RpcykTbyAQ/ile9734dH0R16ID4S1omlx1TyVUqAOio0+pB+WaqcbKz/YZ1qmgyNgzIY V+7+/isgr8HoyYovsPbb34l7sIJtTn6U5DIvsanTF5IewruN68fhWa0iV7eavQCX2u5K 04qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="BB9u1j/y"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd28si1972220edb.570.2021.03.11.08.13.57; Thu, 11 Mar 2021 08:14:21 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="BB9u1j/y"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234444AbhCKQKu (ORCPT + 99 others); Thu, 11 Mar 2021 11:10:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234413AbhCKQKs (ORCPT ); Thu, 11 Mar 2021 11:10:48 -0500 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5616C061574; Thu, 11 Mar 2021 08:10:47 -0800 (PST) Received: by mail-oo1-xc2e.google.com with SMTP id r17-20020a4acb110000b02901b657f28cdcso801429ooq.6; Thu, 11 Mar 2021 08:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dsVj1tbMCQQY03XaaBJkVTgd3uxndiFFvZTsqGrWJds=; b=BB9u1j/ywyApxy+fvQ6Y80GTWY6PEK6IszVm6uk/0oKc8cuKcbUGwpDCZdrA1l82kS GLUm3g/ZHaGXntznSqdNAPGVNFP0oVQ74JRTx3t1DB3/xrGMcxzCqYE5jyZ469tU+764 LShxZwfm/b1+Zmub5EcObedm6jN9StjMAzLh1RUKwfhPWFqGCXzd3ixgR4B6Xusg95HW RWEM4W2V+EGZlTsIi2osngdmYqElZIhcqe2vFGGIX8CknahxflvCKJtcOEECGG5bjJJY wVoh/gKA8vZu5/+uFaOa1aNkl2yXjFq+1+of/H8VHAJ4PWsb1debwvdI7NVfwH9JqD4P TItg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dsVj1tbMCQQY03XaaBJkVTgd3uxndiFFvZTsqGrWJds=; b=psRtWaSUhle+1Yo2L1m6OrnGb8y7P11GLAFepaDOnaEW4+uswhaT2TJvLgB+17rAWX 5pin+QdfWnlekJHPKsnQHt4CTlUHeasO0U2AH6MdCvIeLIcFZZpE7FSylDXlJmHBeXQT AfCgt3ivq7ohr5QgDX2fXlyBMQftTD+LNQBet/TjqibxxQ2At+Or/b/hWJVo+XbvIsQN Ab6Ngo7VV3vWnQ1tZWDxV8wtaR0SzrLI0/OmchwRZdeWnWNkXD6ZhmKPlYB4HrlTXJx2 Qx7OwcsuZVct/gUGPdEYy+gLpCPtSgAgKdW+eq4eOtubCS8qpf7gWdjVBkd8jeh3Yj72 GsfQ== X-Gm-Message-State: AOAM532EQoGGHwcheaLG6LnahJE5zEJtQ1IZd4Uked1o5aUJ4t641djw XivqMqa1Gmcfy3g3WaTpGi70fMwjtXFY9apNP0I= X-Received: by 2002:a4a:8961:: with SMTP id g30mr5266790ooi.72.1615479046676; Thu, 11 Mar 2021 08:10:46 -0800 (PST) MIME-Version: 1.0 References: <20210310163655.2591893-1-daniel@qtec.com> In-Reply-To: From: Alex Deucher Date: Thu, 11 Mar 2021 11:10:35 -0500 Message-ID: Subject: Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk To: Alexandre Desnoyers Cc: Daniel Gomez , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Sumit Semwal , Hawking Zhang , Huang Rui , Nirmoy Das , Dennis Li , Monk Liu , Yintian Tao , Guchun Chen , Evan Quan , amd-gfx list , Maling list - DRI developers , LKML , linux-media , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: multipart/mixed; boundary="000000000000b83e0205bd45069a" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000b83e0205bd45069a Content-Type: text/plain; charset="UTF-8" On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers wrote: > > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez wrote: > > > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez wrote: > > > > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher wrote: > > > > > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez wrote: > > > > > > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83. > > > > > > > > > > Signed-off-by: Daniel Gomez > > > > > --- > > > > > > > > > > This patch is a continuation of the work here: > > > > > https://lkml.org/lkml/2021/2/3/122 where a hardware lockup was discussed and > > > > > a dma_fence deadlock was provoke as a side effect. To reproduce the issue > > > > > please refer to the above link. > > > > > > > > > > The hardware lockup was introduced in 5.6-rc1 for our particular revision as it > > > > > wasn't part of the new blacklist. Before that, in kernel v5.5, this hardware was > > > > > working fine without any hardware lock because the GFXOFF was actually disabled > > > > > by the if condition for the CHIP_RAVEN case. So this patch, adds the 'Radeon > > > > > Vega Mobile Series [1002:15dd] (rev 83)' to the blacklist to disable the GFXOFF. > > > > > > > > > > But besides the fix, I'd like to ask from where this revision comes from. Is it > > > > > an ASIC revision or is it hardcoded in the VBIOS from our vendor? From what I > > > > > can see, it comes from the ASIC and I wonder if somehow we can get an APU in the > > > > > future, 'not blacklisted', with the same problem. Then, should this table only > > > > > filter for the vendor and device and not the revision? Do you know if there are > > > > > any revisions for the 1002:15dd validated, tested and functional? > > > > > > > > The pci revision id (RID) is used to specify the specific SKU within a > > > > family. GFXOFF is supposed to be working on all raven variants. It > > > > was tested and functional on all reference platforms and any OEM > > > > platforms that launched with Linux support. There are a lot of > > > > dependencies on sbios in the early raven variants (0x15dd), so it's > > > > likely more of a specific platform issue, but there is not a good way > > > > to detect this so we use the DID/SSID/RID as a proxy. The newer raven > > > > variants (0x15d8) have much better GFXOFF support since they all > > > > shipped with newer firmware and sbios. > > > > > > We took one of the first reference platform boards to design our > > > custom board based on the V1605B and I assume it has one of the early 'unstable' > > > raven variants with RID 0x83. Also, as OEM we are in control of the bios > > > (provided by insyde) but I wasn't sure about the RID so, thanks for the > > > clarification. Is there anything we can do with the bios to have the GFXOFF > > > enabled and 'stable' for this particular revision? Otherwise we'd need to add > > > the 0x83 RID to the table. Also, there is an extra ']' in the patch > > > subject. Sorry > > > for that. Would you need a new patch in case you accept it with the ']' removed? > > > > > > Good to hear that the newer raven versions have better GFXOFF support. > > > > Adding Alex Desnoyer to the loop as he is the electronic/hardware and > > bios responsible so, he can > > provide more information about this. > > Hello everyone, > > We, Qtechnology, are the OEM of the hardware platform where we > originally discovered the bug. Our platform is based on the AMD > Dibbler V-1000 reference design, with the latest Insyde BIOS release > available for the (now unsupported) Dibbler platform. We have the > Insyde BIOS source code internally, so we can make some modifications > as needed. > > The last test that Daniel and myself performed was on a standard > Dibbler PCB rev.B1 motherboard (NOT our platform), and using the > corresponding latest AMD released BIOS "RDB1109GA". As Daniel wrote, > the hardware lockup can be reproduced on the Dibbler, even if it has a > different RID that our V1605B APU. > > We also have a Neousys Technology POC-515 embedded computer (V-1000, > V1605B) in our office. The Neousys PC also uses Insyde BIOS. This > computer is also locking-up in the test. > https://www.neousys-tech.com/en/product/application/rugged-embedded/poc-500-amd-ryzen-ultra-compact-embedded-computer > > > Digging into the BIOS source code, the only reference to GFXOFF is in > the SMU and PSP firmware release notes, where some bug fixes have been > mentioned for previous SMU/PSP releases. After a quick "git grep -i > gfx | grep -i off", there seems to be no mention of GFXOFF in the > Insyde UEFI (inluding AMD PI) code base. I would appreciate any > information regarding BIOS modification needed to make the GFXOFF > feature stable. As you (Alex Deucher) mentionned, it should be > functional on all AMD Raven reference platforms. > It's handled by the firmwares carried by the sbios. I'm not sure what versions off hand. Probably want to make sure you have the latest ones. Do you have an AMD partner contact? It might be best to bring this up with them. Regarding the issues you are seeing is this a general issue with all workloads that use the GFX shader cores? Or just specific workloads? If it's just compute workloads, you might try this patch. It may fix the issue for you. Alex > > Regards, > > Alexandre Desnoyers > > > > > > I've now done a test on the reference platform (dibbler) with the > > latest bios available > > and the hw lockup can be also reproduced with the same steps. > > > > For reference, I'm using mainline kernel 5.12-rc2. > > > > [ 5.938544] [drm] initializing kernel modesetting (RAVEN > > 0x1002:0x15DD 0x1002:0x15DD 0xC1). > > [ 5.939942] amdgpu: ATOM BIOS: 113-RAVEN-11 > > > > As in the previous cases, the clocks go to 100% of usage when the hang occurs. > > > > However, when the gpu hangs, dmesg output displays the following: > > > > [ 1568.279847] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx > > timeout, signaled seq=188, emitted seq=191 > > [ 1568.434084] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process > > information: process Xorg pid 311 thread Xorg:cs0 pid 312 > > [ 1568.279847] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx > > timeout, signaled seq=188, emitted seq=191 > > [ 1568.434084] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process > > information: process Xorg pid 311 thread Xorg:cs0 pid 312 > > [ 1568.507000] amdgpu 0000:01:00.0: amdgpu: GPU reset begin! > > [ 1628.491882] rcu: INFO: rcu_sched self-detected stall on CPU > > [ 1628.491882] rcu: 3-...!: (665 ticks this GP) > > idle=f9a/1/0x4000000000000000 softirq=188533/188533 fqs=15 > > [ 1628.491882] rcu: rcu_sched kthread timer wakeup didn't happen for > > 58497 jiffies! g726761 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 > > [ 1628.491882] rcu: Possible timer handling issue on cpu=2 > > timer-softirq=55225 > > [ 1628.491882] rcu: rcu_sched kthread starved for 58500 jiffies! > > g726761 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=2 > > [ 1628.491882] rcu: Unless rcu_sched kthread gets sufficient CPU > > time, OOM is now expected behavior. > > [ 1628.491882] rcu: RCU grace-period kthread stack dump: > > [ 1628.491882] rcu: Stack dump where RCU GP kthread last ran: > > [ 1808.518445] rcu: INFO: rcu_sched self-detected stall on CPU > > [ 1808.518445] rcu: 3-...!: (2643 ticks this GP) > > idle=f9a/1/0x4000000000000000 softirq=188533/188533 fqs=15 > > [ 1808.518445] rcu: rcu_sched kthread starved for 238526 jiffies! > > g726761 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=2 > > [ 1808.518445] rcu: Unless rcu_sched kthread gets sufficient CPU > > time, OOM is now expected behavior. > > [ 1808.518445] rcu: RCU grace-period kthread stack dump: > > [ 1808.518445] rcu: Stack dump where RCU GP kthread last ran: > > > > > > > > Daniel > > > > > > > > > > > Alex > > > > > > > > > > > > > > > > > > Logs: > > > > > [ 27.708348] [drm] initializing kernel modesetting (RAVEN > > > > > 0x1002:0x15DD 0x1002:0x15DD 0x83). > > > > > [ 27.789156] amdgpu: ATOM BIOS: 113-RAVEN-115 > > > > > > > > > > Thanks in advance, > > > > > Daniel > > > > > > > > > > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > > > index 65db88bb6cbc..319d4b99aec8 100644 > > > > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > > > @@ -1243,6 +1243,8 @@ static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = { > > > > > { 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 }, > > > > > /* GFXOFF is unstable on C6 parts with a VBIOS 113-RAVEN-114 */ > > > > > { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc6 }, > > > > > + /* GFXOFF provokes a hw lockup on 83 parts with a VBIOS 113-RAVEN-115 */ > > > > > + { 0x1002, 0x15dd, 0x1002, 0x15dd, 0x83 }, > > > > > { 0, 0, 0, 0, 0 }, > > > > > }; > > > > > > > > > > -- > > > > > 2.30.1 > > > > > > > > > > _______________________________________________ > > > > > dri-devel mailing list > > > > > dri-devel@lists.freedesktop.org > > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel --000000000000b83e0205bd45069a Content-Type: text/x-patch; charset="US-ASCII"; name="0001-drm-amdgpu-disable-gfxoff-for-ROCm-workloads-on-Rave.patch" Content-Disposition: attachment; filename="0001-drm-amdgpu-disable-gfxoff-for-ROCm-workloads-on-Rave.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_km52gtq70 RnJvbSA5ZmMxZWM5YTFhZGRhMmEzMzNhNGVjYTEyMGEwZjU2MTk5ZWE4MGRlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGV4IERldWNoZXIgPGFsZXhhbmRlci5kZXVjaGVyQGFtZC5j b20+CkRhdGU6IFRodSwgMTEgTWFyIDIwMjEgMTE6MDI6NTEgLTA1MDAKU3ViamVjdDogW1BBVENI XSBkcm0vYW1kZ3B1OiBkaXNhYmxlIGdmeG9mZiBmb3IgU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