Skip to contentSkip to conversation

drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV

PATCH In review Christian König 3 participants 4 messages Apr 17, 2018 – Apr 18, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV

Turned out that this locks up some bare metal Vega10.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -1
index 583f6f616dd3..5329d7e5fb71 100644
@@ -4144,7 +4144,12 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
 {
 	int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
 
-	gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
+	if (amdgpu_sriov_vf(adev))
+		gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1,
+				      ref, mask, 0x20);
+	else
+		amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1,
+							   ref, mask);
 }
 
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180417130135.1895-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch? The behavior of this packet should be the same as SDMA and that definitely doesn't work. I don't see why this would be any different.

Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Tuesday, April 17, 2018 9:01:35 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV

Turned out that this locks up some bare metal Vega10.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -1
index 583f6f616dd3..5329d7e5fb71 100644
@@ -4144,7 +4144,12 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
 {
         int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
 
-       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
+       if (amdgpu_sriov_vf(adev))
+               gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1,
+                                     ref, mask, 0x20);
+       else
+               amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1,
+                                                          ref, mask);
 }
 
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

--
2.14.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): DM5PR12MB1820165CD71A527EAA47C5F4F7B70-2J9CzHegvk8qWyLXlBb1HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 1 line

Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch?

I honestly don't know. I think that SR-IOV uses a specialized firmware where this packet has a different meaning.

But the real fix would be to get the RLC firmware fix to not reinitialize those regs to zero on world switch.

Christian.

Am 17.04.2018 um 16:02 schrieb Deucher, Alexander:

Quoted 40 lines

Does this actually work on SR-IOV?  Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch?  The behavior of this packet should be the same as SDMA and that definitely doesn't work.  I don't see why this would be any different.

Alex

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Tuesday, April 17, 2018 9:01:35 AM
*To:* [email protected]
*Subject:* [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV
Turned out that this locks up some bare metal Vega10.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -1
index 583f6f616dd3..5329d7e5fb71 100644
@@ -4144,7 +4144,12 @@ static void 
 gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
  {
          int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
 
-       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, 
 mask, 0x20);
+       if (amdgpu_sriov_vf(adev))
+               gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1,
+                                     ref, mask, 0x20);
+       else
+ amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1,
+ ref, mask);
  }
Quoted 8 lines

 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 0cf6dae0-afae-c858-73af-ab47673a7d8a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Acked-by Alex Deucher
#6 lore raw

Hi all,
Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch? I honestly don't know. I think that SR-IOV uses a specialized firmware where this packet has a different meaning.

But the real fix would be to get the RLC firmware fix to not reinitialize those regs to zero on world switch. [Emily]Yes, it actually works on SR-IOV, it fixes lots of engine hang issue.

Best Wishes,
Emily Deng
From: Christian König [mailto:[email protected]]
Sent: Tuesday, April 17, 2018 11:27 PM
To: Deucher, Alexander <[email protected]>; amd-gfx-PD4FTy7X32nrcLQh/[email protected]; Deng, Emily <[email protected]>; Liu, Monk <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV

Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch? I honestly don't know. I think that SR-IOV uses a specialized firmware where this packet has a different meaning.

But the real fix would be to get the RLC firmware fix to not reinitialize those regs to zero on world switch.

Christian.

Am 17.04.2018 um 16:02 schrieb Deucher, Alexander:

Does this actually work on SR-IOV? Or does it just seem to but nothing bad happens because we get a GPU reset on a world switch? The behavior of this packet should be the same as SDMA and that definitely doesn't work. I don't see why this would be any different.

Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:[email protected]> on behalf of Christian König <[email protected]><mailto:[email protected]>
Sent: Tuesday, April 17, 2018 9:01:35 AM
To: [email protected]<mailto:[email protected]>
Subject: [PATCH] drm/amdgpu: limit reg_write_reg_wait workaround to SRIOV

Turned out that this locks up some bare metal Vega10.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -1
index 583f6f616dd3..5329d7e5fb71 100644
@@ -4144,7 +4144,12 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
 {
         int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
 
-       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
+       if (amdgpu_sriov_vf(adev))
+               gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1,
+                                     ref, mask, 0x20);
+       else
+               amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1,
+                                                          ref, mask);
 }
 
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

--
2.14.1

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx