All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-10 16:36 ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-10 16:36 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Daniel Vetter,
	Sumit Semwal, Hawking Zhang, Huang Rui, Nirmoy Das, Dennis Li,
	Monk Liu, Yintian Tao, Guchun Chen, Evan Quan, amd-gfx,
	dri-devel, linux-kernel, linux-media, linaro-mm-sig
  Cc: Daniel Gomez

Disabling GFXOFF via the quirk list fixes a hardware lockup in
Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.

Signed-off-by: Daniel Gomez <daniel@qtec.com>
---

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?

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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-10 16:36 ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-10 16:36 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Daniel Vetter,
	Sumit Semwal, Hawking Zhang, Huang Rui, Nirmoy Das, Dennis Li,
	Monk Liu, Yintian Tao, Guchun Chen, Evan Quan, amd-gfx,
	dri-devel, linux-kernel, linux-media, linaro-mm-sig
  Cc: Daniel Gomez

Disabling GFXOFF via the quirk list fixes a hardware lockup in
Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.

Signed-off-by: Daniel Gomez <daniel@qtec.com>
---

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?

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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-10 16:36 ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-10 16:36 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Daniel Vetter,
	Sumit Semwal, Hawking Zhang, Huang Rui, Nirmoy Das, Dennis Li,
	Monk Liu, Yintian Tao, Guchun Chen, Evan Quan, amd-gfx,
	dri-devel, linux-kernel, linux-media, linaro-mm-sig
  Cc: Daniel Gomez

Disabling GFXOFF via the quirk list fixes a hardware lockup in
Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.

Signed-off-by: Daniel Gomez <daniel@qtec.com>
---

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?

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-10 16:36 ` Daniel Gomez
  (?)
@ 2021-03-10 17:06   ` Alex Deucher
  -1 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-10 17:06 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Alex Deucher, Christian König, 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

On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
>
> Disabling GFXOFF via the quirk list fixes a hardware lockup in
> Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
>
> Signed-off-by: Daniel Gomez <daniel@qtec.com>
> ---
>
> 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.

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-10 17:06   ` Alex Deucher
  0 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-10 17:06 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alex Deucher, Yintian Tao, Christian König, Dennis Li,
	Hawking Zhang

On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
>
> Disabling GFXOFF via the quirk list fixes a hardware lockup in
> Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
>
> Signed-off-by: Daniel Gomez <daniel@qtec.com>
> ---
>
> 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.

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-10 17:06   ` Alex Deucher
  0 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-10 17:06 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Sumit Semwal, moderated list:DMA BUFFER SHARING FRAMEWORK,
	Huang Rui, Monk Liu, Daniel Vetter, Alex Deucher, Yintian Tao,
	Christian König, Dennis Li, Hawking Zhang

On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
>
> Disabling GFXOFF via the quirk list fixes a hardware lockup in
> Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
>
> Signed-off-by: Daniel Gomez <daniel@qtec.com>
> ---
>
> 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.

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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-10 17:06   ` Alex Deucher
  (?)
@ 2021-03-11  9:09     ` Daniel Gomez
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11  9:09 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, Christian König, 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

On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> >
> > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > ---
> >
> > 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.

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11  9:09     ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11  9:09 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alex Deucher, Yintian Tao, Christian König, Dennis Li,
	Hawking Zhang

On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> >
> > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > ---
> >
> > 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.

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11  9:09     ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11  9:09 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Sumit Semwal, moderated list:DMA BUFFER SHARING FRAMEWORK,
	Huang Rui, Monk Liu, Daniel Vetter, Alex Deucher, Yintian Tao,
	Christian König, Dennis Li, Hawking Zhang

On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> >
> > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > ---
> >
> > 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.

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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-11  9:09     ` Daniel Gomez
  (?)
@ 2021-03-11 13:48       ` Daniel Gomez
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 13:48 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, Christian König, 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, Alex Desnoyers

On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
>
> On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > >
> > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > ---
> > >
> > > 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.

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 13:48       ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 13:48 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alex Desnoyers, Alex Deucher, Yintian Tao, Christian König,
	Dennis Li, Hawking Zhang

On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
>
> On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > >
> > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > ---
> > >
> > > 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.

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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 13:48       ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 13:48 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Sumit Semwal, moderated list:DMA BUFFER SHARING FRAMEWORK,
	Huang Rui, Monk Liu, Daniel Vetter, Alex Desnoyers, Alex Deucher,
	Yintian Tao, Christian König, Dennis Li, Hawking Zhang

On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
>
> On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > >
> > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > ---
> > >
> > > 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.

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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-11 13:48       ` Daniel Gomez
  (?)
@ 2021-03-11 15:02         ` Alexandre Desnoyers
  -1 siblings, 0 replies; 26+ messages in thread
From: Alexandre Desnoyers @ 2021-03-11 15:02 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Alex Deucher, Alex Deucher, Christian König, 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

On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
>
> On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > >
> > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > >
> > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > ---
> > > >
> > > > 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.


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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 15:02         ` Alexandre Desnoyers
  0 siblings, 0 replies; 26+ messages in thread
From: Alexandre Desnoyers @ 2021-03-11 15:02 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Alex Deucher,
	Huang Rui, Monk Liu, Yintian Tao, Christian König,
	Dennis Li, Hawking Zhang

On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
>
> On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > >
> > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > >
> > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > ---
> > > >
> > > > 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.


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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 15:02         ` Alexandre Desnoyers
  0 siblings, 0 replies; 26+ messages in thread
From: Alexandre Desnoyers @ 2021-03-11 15:02 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Sumit Semwal, moderated list:DMA BUFFER SHARING FRAMEWORK,
	Alex Deucher, Huang Rui, Monk Liu, Daniel Vetter, Alex Deucher,
	Yintian Tao, Christian König, Dennis Li, Hawking Zhang

On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
>
> On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > >
> > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > >
> > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > ---
> > > >
> > > > 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.


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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-11 15:02         ` Alexandre Desnoyers
  (?)
@ 2021-03-11 16:10           ` Alex Deucher
  -1 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-11 16:10 UTC (permalink / raw)
  To: Alexandre Desnoyers
  Cc: Daniel Gomez, Alex Deucher, Christian König, 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

[-- Attachment #1: Type: text/plain, Size: 9409 bytes --]

On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
>
> On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > >
> > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > >
> > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > >
> > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > ---
> > > > >
> > > > > 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

[-- Attachment #2: 0001-drm-amdgpu-disable-gfxoff-for-ROCm-workloads-on-Rave.patch --]
[-- Type: text/x-patch, Size: 1151 bytes --]

From 9fc1ec9a1adda2a333a4eca120a0f56199ea80de Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Thu, 11 Mar 2021 11:02:51 -0500
Subject: [PATCH] drm/amdgpu: disable gfxoff for ROCm workloads on Raven1

Causes hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index fa27262b5c2a..894215ce346a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -642,7 +642,9 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle)
 	/* Temp workaround to fix the soft hang observed in certain compute
 	 * applications if GFXOFF is enabled.
 	 */
-	if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+	if ((adev->asic_type == CHIP_SIENNA_CICHLID) ||
+	    ((adev->asic_type == CHIP_RAVEN) &&
+	     (adev->apu_flags &AMD_APU_IS_RAVEN))) {
 		pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
 		amdgpu_gfx_off_ctrl(adev, idle);
 	}
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 16:10           ` Alex Deucher
  0 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-11 16:10 UTC (permalink / raw)
  To: Alexandre Desnoyers
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alex Deucher, Daniel Gomez, Yintian Tao, Christian König,
	Dennis Li, Hawking Zhang

[-- Attachment #1: Type: text/plain, Size: 9409 bytes --]

On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
>
> On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > >
> > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > >
> > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > >
> > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > ---
> > > > >
> > > > > 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

[-- Attachment #2: 0001-drm-amdgpu-disable-gfxoff-for-ROCm-workloads-on-Rave.patch --]
[-- Type: text/x-patch, Size: 1151 bytes --]

From 9fc1ec9a1adda2a333a4eca120a0f56199ea80de Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Thu, 11 Mar 2021 11:02:51 -0500
Subject: [PATCH] drm/amdgpu: disable gfxoff for ROCm workloads on Raven1

Causes hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index fa27262b5c2a..894215ce346a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -642,7 +642,9 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle)
 	/* Temp workaround to fix the soft hang observed in certain compute
 	 * applications if GFXOFF is enabled.
 	 */
-	if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+	if ((adev->asic_type == CHIP_SIENNA_CICHLID) ||
+	    ((adev->asic_type == CHIP_RAVEN) &&
+	     (adev->apu_flags &AMD_APU_IS_RAVEN))) {
 		pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
 		amdgpu_gfx_off_ctrl(adev, idle);
 	}
-- 
2.29.2


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 16:10           ` Alex Deucher
  0 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2021-03-11 16:10 UTC (permalink / raw)
  To: Alexandre Desnoyers
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Sumit Semwal, moderated list:DMA BUFFER SHARING FRAMEWORK,
	Huang Rui, Monk Liu, Daniel Vetter, Alex Deucher, Daniel Gomez,
	Yintian Tao, Christian König, Dennis Li, Hawking Zhang

[-- Attachment #1: Type: text/plain, Size: 9409 bytes --]

On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
>
> On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> >
> > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > >
> > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > >
> > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > >
> > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > ---
> > > > >
> > > > > 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

[-- Attachment #2: 0001-drm-amdgpu-disable-gfxoff-for-ROCm-workloads-on-Rave.patch --]
[-- Type: text/x-patch, Size: 1151 bytes --]

From 9fc1ec9a1adda2a333a4eca120a0f56199ea80de Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Thu, 11 Mar 2021 11:02:51 -0500
Subject: [PATCH] drm/amdgpu: disable gfxoff for ROCm workloads on Raven1

Causes hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index fa27262b5c2a..894215ce346a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -642,7 +642,9 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle)
 	/* Temp workaround to fix the soft hang observed in certain compute
 	 * applications if GFXOFF is enabled.
 	 */
-	if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+	if ((adev->asic_type == CHIP_SIENNA_CICHLID) ||
+	    ((adev->asic_type == CHIP_RAVEN) &&
+	     (adev->apu_flags &AMD_APU_IS_RAVEN))) {
 		pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
 		amdgpu_gfx_off_ctrl(adev, idle);
 	}
-- 
2.29.2


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-11 16:10           ` Alex Deucher
  (?)
@ 2021-03-11 20:00             ` Daniel Gomez
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 20:00 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alexandre Desnoyers, Alex Deucher, Christian König,
	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

On Thu, 11 Mar 2021 at 17:10, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > > >
> > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > > >
> > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > > >
> > > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > > ---
> > > > > >
> > > > > > 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.
I'm sure we were using the latest but let us double-check with our
AMD partner and insyde just in case.
>
> 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.
Thanks Alex for the patch. I think it's kind of a general issue with all the
workloads but the way we've been able to reproduce it was with the
MatrixMultiplication test (from AMD) and clinfo. With the patch, I'm
still able to reproduce the problem in our custom board. I'll check it
tomorrow on the dribbler.
>
> 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 20:00             ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 20:00 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Christian König,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alexandre Desnoyers, Alex Deucher, Yintian Tao, Dennis Li,
	Hawking Zhang

On Thu, 11 Mar 2021 at 17:10, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > > >
> > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > > >
> > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > > >
> > > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > > ---
> > > > > >
> > > > > > 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.
I'm sure we were using the latest but let us double-check with our
AMD partner and insyde just in case.
>
> 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.
Thanks Alex for the patch. I think it's kind of a general issue with all the
workloads but the way we've been able to reproduce it was with the
MatrixMultiplication test (from AMD) and clinfo. With the patch, I'm
still able to reproduce the problem in our custom board. I'll check it
tomorrow on the dribbler.
>
> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-11 20:00             ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-11 20:00 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Christian König,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Daniel Vetter, Alexandre Desnoyers, Alex Deucher, Yintian Tao,
	Sumit Semwal, Dennis Li, Hawking Zhang

On Thu, 11 Mar 2021 at 17:10, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> > >
> > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > > >
> > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com> wrote:
> > > > > >
> > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > > >
> > > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > > ---
> > > > > >
> > > > > > 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.
I'm sure we were using the latest but let us double-check with our
AMD partner and insyde just in case.
>
> 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.
Thanks Alex for the patch. I think it's kind of a general issue with all the
workloads but the way we've been able to reproduce it was with the
MatrixMultiplication test (from AMD) and clinfo. With the patch, I'm
still able to reproduce the problem in our custom board. I'll check it
tomorrow on the dribbler.
>
> 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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
  2021-03-11 20:00             ` Daniel Gomez
@ 2021-03-12 16:17               ` Daniel Gomez
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-12 16:17 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Christian König,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Alexandre Desnoyers, Alex Deucher, Yintian Tao, Dennis Li,
	Hawking Zhang


[-- Attachment #1.1: Type: text/plain, Size: 12200 bytes --]

On Thu, 11 Mar 2021 at 21:00, Daniel Gomez <daniel@qtec.com> wrote:

> On Thu, 11 Mar 2021 at 17:10, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com>
> wrote:
> > >
> > > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > > > >
> > > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com>
> wrote:
> > > > > >
> > > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com>
> wrote:
> > > > > > >
> > > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > > > >
> > > > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > > > ---
> > > > > > >
> > > > > > > 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.
> I'm sure we were using the latest but let us double-check with our
> AMD partner and insyde just in case.
> >
> > 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.
> Thanks Alex for the patch. I think it's kind of a general issue with all
> the
> workloads but the way we've been able to reproduce it was with the
> MatrixMultiplication test (from AMD) and clinfo. With the patch, I'm
> still able to reproduce the problem in our custom board. I'll check it
> tomorrow on the dribbler.
>
Quick update on this:
I've tested the patch on the dribbler and the hang also occurs. What
we are now trying to figure out if we actually have the latest bios
available for the V1605B (we think we do) but this might take a while
(already reported
to the AMD partner).
To add more info about our current bios:
Dibbler:
-  Version: RDB1109GA
-  AGESA version: RavenPi-FP5-AM4 1.1.0.9
-  VBIOS 0113
QT5222 (V1605B with Radeon Vega Gfx 8):
-  Version: 0.0.29
-  AGESA version: RavenPi-FP5-AM4 1.1.0.A
-  VBIOS 0115

Also, in the release notes for the latest amdgpu release available in the
amd support page
says: "Disable the GFXOFF for OpenCL(ROCm 3.8) usage as below in the grub.
Workaround: add “amdgpu.ppfeaturemask=0xffff3fff”in the grub." which
confirms the issue.
https://drivers.amd.com/relnotes/linux_driver_2020.40_release_notes.pdf

My final question would be if we can/should add the patch as there are
other raven
devices already added with different revision 0x1002:0x15dd {0xc8,0xc6} or
we
should wait forAMD-partner confirmation to know if the bios/raven is buggy
or not.

>
> > 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
>

[-- Attachment #1.2: Type: text/html, Size: 16570 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk
@ 2021-03-12 16:17               ` Daniel Gomez
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Gomez @ 2021-03-12 16:17 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Evan Quan, linux-media, Guchun Chen, David Airlie,
	Maling list - DRI developers, Nirmoy Das, LKML, amd-gfx list,
	Christian König,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Huang Rui, Monk Liu,
	Daniel Vetter, Alexandre Desnoyers, Alex Deucher, Yintian Tao,
	Sumit Semwal, Dennis Li, Hawking Zhang


[-- Attachment #1.1: Type: text/plain, Size: 12200 bytes --]

On Thu, 11 Mar 2021 at 21:00, Daniel Gomez <daniel@qtec.com> wrote:

> On Thu, 11 Mar 2021 at 17:10, Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 10:02 AM Alexandre Desnoyers <alex@qtec.com>
> wrote:
> > >
> > > On Thu, Mar 11, 2021 at 2:49 PM Daniel Gomez <daniel@qtec.com> wrote:
> > > >
> > > > On Thu, 11 Mar 2021 at 10:09, Daniel Gomez <daniel@qtec.com> wrote:
> > > > >
> > > > > On Wed, 10 Mar 2021 at 18:06, Alex Deucher <alexdeucher@gmail.com>
> wrote:
> > > > > >
> > > > > > On Wed, Mar 10, 2021 at 11:37 AM Daniel Gomez <daniel@qtec.com>
> wrote:
> > > > > > >
> > > > > > > Disabling GFXOFF via the quirk list fixes a hardware lockup in
> > > > > > > Ryzen V1605B, RAVEN 0x1002:0x15DD rev 0x83.
> > > > > > >
> > > > > > > Signed-off-by: Daniel Gomez <daniel@qtec.com>
> > > > > > > ---
> > > > > > >
> > > > > > > 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.
> I'm sure we were using the latest but let us double-check with our
> AMD partner and insyde just in case.
> >
> > 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.
> Thanks Alex for the patch. I think it's kind of a general issue with all
> the
> workloads but the way we've been able to reproduce it was with the
> MatrixMultiplication test (from AMD) and clinfo. With the patch, I'm
> still able to reproduce the problem in our custom board. I'll check it
> tomorrow on the dribbler.
>
Quick update on this:
I've tested the patch on the dribbler and the hang also occurs. What
we are now trying to figure out if we actually have the latest bios
available for the V1605B (we think we do) but this might take a while
(already reported
to the AMD partner).
To add more info about our current bios:
Dibbler:
-  Version: RDB1109GA
-  AGESA version: RavenPi-FP5-AM4 1.1.0.9
-  VBIOS 0113
QT5222 (V1605B with Radeon Vega Gfx 8):
-  Version: 0.0.29
-  AGESA version: RavenPi-FP5-AM4 1.1.0.A
-  VBIOS 0115

Also, in the release notes for the latest amdgpu release available in the
amd support page
says: "Disable the GFXOFF for OpenCL(ROCm 3.8) usage as below in the grub.
Workaround: add “amdgpu.ppfeaturemask=0xffff3fff”in the grub." which
confirms the issue.
https://drivers.amd.com/relnotes/linux_driver_2020.40_release_notes.pdf

My final question would be if we can/should add the patch as there are
other raven
devices already added with different revision 0x1002:0x15dd {0xc8,0xc6} or
we
should wait forAMD-partner confirmation to know if the bios/raven is buggy
or not.

>
> > 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
>

[-- Attachment #1.2: Type: text/html, Size: 16570 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] drm/amdgpu/gfx9: add gfxoff quirk
  2020-04-13 15:02 ` Alex Deucher
@ 2020-04-14  2:42   ` Huang Rui
  0 siblings, 0 replies; 26+ messages in thread
From: Huang Rui @ 2020-04-14  2:42 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, amd-gfx list

On Mon, Apr 13, 2020 at 11:02:22AM -0400, Alex Deucher wrote:
> Ping?
> 
> Alex
> 
> On Thu, Apr 9, 2020 at 11:43 AM Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > Fix screen corruption with firefox.
> >
> > Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D207171&amp;data=02%7C01%7Cray.huang%40amd.com%7Cf75dec23c4b04383199e08d7dfbbb4c3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637223870207754970&amp;sdata=5vPHypd4xqJd8CvmjRMfX3%2BPfmXjZHFkZobgvL4uOto%3D&amp;reserved=0
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> > ---
> >  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 1d18447129b1..e14ff65ac735 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > @@ -1231,6 +1231,8 @@ struct amdgpu_gfxoff_quirk {
> >  static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = {
> >         /* https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D204689&amp;data=02%7C01%7Cray.huang%40amd.com%7Cf75dec23c4b04383199e08d7dfbbb4c3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637223870207754970&amp;sdata=OsJ3VfUdU1APJ%2BJhIgrzoqAZ%2BjP0YL1gwf3%2FAnHJnDk%3D&amp;reserved=0 */
> >         { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
> > +       /* https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D207171&amp;data=02%7C01%7Cray.huang%40amd.com%7Cf75dec23c4b04383199e08d7dfbbb4c3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637223870207754970&amp;sdata=5vPHypd4xqJd8CvmjRMfX3%2BPfmXjZHFkZobgvL4uOto%3D&amp;reserved=0 */
> > +       { 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 },
> >         { 0, 0, 0, 0, 0 },
> >  };
> >
> > --
> > 2.25.2
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7Cf75dec23c4b04383199e08d7dfbbb4c3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637223870207754970&amp;sdata=Vpz2bX6Dv1VEEgiOxFYaaKqs%2FB1ksl5LBu9v06myyHo%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] drm/amdgpu/gfx9: add gfxoff quirk
  2020-04-09 15:42 [PATCH] " Alex Deucher
@ 2020-04-13 15:02 ` Alex Deucher
  2020-04-14  2:42   ` Huang Rui
  0 siblings, 1 reply; 26+ messages in thread
From: Alex Deucher @ 2020-04-13 15:02 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Alex Deucher

Ping?

Alex

On Thu, Apr 9, 2020 at 11:43 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> Fix screen corruption with firefox.
>
> Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207171
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  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 1d18447129b1..e14ff65ac735 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -1231,6 +1231,8 @@ struct amdgpu_gfxoff_quirk {
>  static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = {
>         /* https://bugzilla.kernel.org/show_bug.cgi?id=204689 */
>         { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
> +       /* https://bugzilla.kernel.org/show_bug.cgi?id=207171 */
> +       { 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 },
>         { 0, 0, 0, 0, 0 },
>  };
>
> --
> 2.25.2
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH] drm/amdgpu/gfx9: add gfxoff quirk
@ 2020-04-09 15:42 Alex Deucher
  2020-04-13 15:02 ` Alex Deucher
  0 siblings, 1 reply; 26+ messages in thread
From: Alex Deucher @ 2020-04-09 15:42 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

Fix screen corruption with firefox.

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207171
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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 1d18447129b1..e14ff65ac735 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1231,6 +1231,8 @@ struct amdgpu_gfxoff_quirk {
 static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = {
 	/* https://bugzilla.kernel.org/show_bug.cgi?id=204689 */
 	{ 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
+	/* https://bugzilla.kernel.org/show_bug.cgi?id=207171 */
+	{ 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 },
 	{ 0, 0, 0, 0, 0 },
 };
 
-- 
2.25.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-03-12 16:17 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 16:36 [PATCH]] drm/amdgpu/gfx9: add gfxoff quirk Daniel Gomez
2021-03-10 16:36 ` Daniel Gomez
2021-03-10 16:36 ` Daniel Gomez
2021-03-10 17:06 ` Alex Deucher
2021-03-10 17:06   ` Alex Deucher
2021-03-10 17:06   ` Alex Deucher
2021-03-11  9:09   ` Daniel Gomez
2021-03-11  9:09     ` Daniel Gomez
2021-03-11  9:09     ` Daniel Gomez
2021-03-11 13:48     ` Daniel Gomez
2021-03-11 13:48       ` Daniel Gomez
2021-03-11 13:48       ` Daniel Gomez
2021-03-11 15:02       ` Alexandre Desnoyers
2021-03-11 15:02         ` Alexandre Desnoyers
2021-03-11 15:02         ` Alexandre Desnoyers
2021-03-11 16:10         ` Alex Deucher
2021-03-11 16:10           ` Alex Deucher
2021-03-11 16:10           ` Alex Deucher
2021-03-11 20:00           ` Daniel Gomez
2021-03-11 20:00             ` Daniel Gomez
2021-03-11 20:00             ` Daniel Gomez
2021-03-12 16:17             ` Daniel Gomez
2021-03-12 16:17               ` Daniel Gomez
  -- strict thread matches above, loose matches on Subject: below --
2020-04-09 15:42 [PATCH] " Alex Deucher
2020-04-13 15:02 ` Alex Deucher
2020-04-14  2:42   ` Huang Rui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.