Skip to contentSkip to conversation

The vega10 sriov still need those patches

PATCH Superseded Emily Deng 5 participants 14 messages Apr 3, 2018 – Apr 4, 2018 4 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Emily Deng

author
#0 lore raw

cover The vega10 sriov still need those patches

For vega10 sriov, still need to use one package for invalidate tlb flush

Emily Deng (8):
Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/sdma4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/uvd7: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vce4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vcn1: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/gmc9: use
amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush""
Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang"" drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

 drivers/gpu/drm/amd/amdgpu/amdgpu.h      |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 20 ++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h |  7 +++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c    | 15 +++++++++++++++
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c    |  8 +++-----
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   |  1 +
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c    |  1 +
 drivers/gpu/drm/amd/amdgpu/vce_v4_0.c    |  1 +
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c    |  1 +
 9 files changed, 50 insertions(+), 5 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1522746482-31353-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 1/8 Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring callback""

This reverts commit cd1f3f010b9ab5f06612cf775b32bdba599f59d7.

The vega10 sriov still need these patches

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h      |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 20 ++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h |  7 +++++++
 3 files changed, 28 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index ed5c22b..3557bed 100644
@@ -1805,6 +1805,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 #define amdgpu_ring_emit_rreg(r, d) (r)->funcs->emit_rreg((r), (d))
 #define amdgpu_ring_emit_wreg(r, d, v) (r)->funcs->emit_wreg((r), (d), (v))
 #define amdgpu_ring_emit_reg_wait(r, d, v, m) (r)->funcs->emit_reg_wait((r), (d), (v), (m))
+#define amdgpu_ring_emit_reg_write_reg_wait(r, d0, d1, v, m) (r)->funcs->emit_reg_write_reg_wait((r), (d0), (d1), (v), (m))
 #define amdgpu_ring_emit_tmz(r, b) (r)->funcs->emit_tmz((r), (b))
 #define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib)))
 #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r))
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +20 -0
index d5f526f..49cad08 100644
@@ -459,6 +459,26 @@ void amdgpu_ring_lru_touch(struct amdgpu_device *adev, struct amdgpu_ring *ring)
 	spin_unlock(&adev->ring_lru_list_lock);
 }
 
+/**
+ * amdgpu_ring_emit_reg_write_reg_wait_helper - ring helper
+ *
+ * @adev: amdgpu_device pointer
+ * @reg0: register to write
+ * @reg1: register to wait on
+ * @ref: reference value to write/wait on
+ * @mask: mask to wait on
+ *
+ * Helper for rings that don't support write and wait in a
+ * single oneshot packet.
+ */
+void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring,
+						uint32_t reg0, uint32_t reg1,
+						uint32_t ref, uint32_t mask)
+{
+	amdgpu_ring_emit_wreg(ring, reg0, ref);
+	amdgpu_ring_emit_reg_wait(ring, reg1, mask, mask);
+}
+
 /*
  * Debugfs info
  */
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +7 -0
index 1d0d250..0b08d87 100644
@@ -152,6 +152,9 @@ struct amdgpu_ring_funcs {
 	void (*emit_wreg)(struct amdgpu_ring *ring, uint32_t reg, uint32_t val);
 	void (*emit_reg_wait)(struct amdgpu_ring *ring, uint32_t reg,
 			      uint32_t val, uint32_t mask);
+	void (*emit_reg_write_reg_wait)(struct amdgpu_ring *ring,
+					uint32_t reg0, uint32_t reg1,
+					uint32_t ref, uint32_t mask);
 	void (*emit_tmz)(struct amdgpu_ring *ring, bool start);
 	/* priority functions */
 	void (*set_priority) (struct amdgpu_ring *ring,
@@ -226,6 +229,10 @@ int amdgpu_ring_lru_get(struct amdgpu_device *adev, int type,
 			int *blacklist, int num_blacklist,
 			bool lru_pipe_order, struct amdgpu_ring **ring);
 void amdgpu_ring_lru_touch(struct amdgpu_device *adev, struct amdgpu_ring *ring);
+void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring,
+						uint32_t reg0, uint32_t val0,
+						uint32_t reg1, uint32_t val1);
+
 static inline void amdgpu_ring_clear_ring(struct amdgpu_ring *ring)
 {
 	int i = 0;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 2/8 Revert "Revert "drm/amdgpu/sdma4: add emit_reg_write_reg_wait ring callback""

In reply to a message not in the archive

This reverts commit eede70ab868f9a3803ad304a5ab61adfa76e669b. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +8 -0
index 2c618a1..dd98d2e 100644
@@ -1171,6 +1171,13 @@ static void sdma_v4_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
 	sdma_v4_0_wait_reg_mem(ring, 0, 0, reg, 0, val, mask, 10);
 }
 
+static void sdma_v4_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
+						   uint32_t reg0, uint32_t reg1,
+						   uint32_t ref, uint32_t mask)
+{
+	sdma_v4_0_wait_reg_mem(ring, 0, 1, reg0, reg1, ref, mask, 10);
+}
+
 static int sdma_v4_0_early_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1611,6 +1618,7 @@ static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
 	.pad_ib = sdma_v4_0_ring_pad_ib,
 	.emit_wreg = sdma_v4_0_ring_emit_wreg,
 	.emit_reg_wait = sdma_v4_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = sdma_v4_0_ring_emit_reg_write_reg_wait,
 };
 
 static void sdma_v4_0_set_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 3/8 Revert "Revert "drm/amdgpu/uvd7: add emit_reg_write_reg_wait ring callback""

In reply to a message not in the archive

This reverts commit 162499bed04e4c51dd0fcbfa1515f9b044f8925e. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +1 -0
index eddc57f..280c082 100644
@@ -1702,6 +1702,7 @@ static const struct amdgpu_ring_funcs uvd_v7_0_enc_ring_vm_funcs = {
 	.end_use = amdgpu_uvd_ring_end_use,
 	.emit_wreg = uvd_v7_0_enc_ring_emit_wreg,
 	.emit_reg_wait = uvd_v7_0_enc_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
 };
 
 static void uvd_v7_0_set_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#5 lore raw

PATCH 4/8 Revert "Revert "drm/amdgpu/vce4: add emit_reg_write_reg_wait ring callback""

In reply to a message not in the archive

This reverts commit afb1f304302f797ff686b6250e34b2244c4a17a4. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1 -0
index 73fd48d..8fd1b74 100755
@@ -1081,6 +1081,7 @@ static const struct amdgpu_ring_funcs vce_v4_0_ring_vm_funcs = {
 	.end_use = amdgpu_vce_ring_end_use,
 	.emit_wreg = vce_v4_0_emit_wreg,
 	.emit_reg_wait = vce_v4_0_emit_reg_wait,
+	.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
 };
 
 static void vce_v4_0_set_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#6 lore raw

PATCH 5/8 Revert "Revert "drm/amdgpu/vcn1: add emit_reg_write_reg_wait ring callback""

In reply to a message not in the archive

This reverts commit bb85e01404ab39c01786d64312a602d5540a9944. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 8c13267..d9a1533 100644
@@ -1139,6 +1139,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_enc_ring_vm_funcs = {
 	.end_use = amdgpu_vcn_ring_end_use,
 	.emit_wreg = vcn_v1_0_enc_ring_emit_wreg,
 	.emit_reg_wait = vcn_v1_0_enc_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
 };
 
 static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#7 lore raw

PATCH 6/8 Revert "Revert "drm/amdgpu/gmc9: use amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush""

In reply to a message not in the archive

This reverts commit c41ed7ebba8eb6df266783f54a4d3d643252ea75. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -5
index 070946e..aeaed7f 100644
@@ -385,11 +385,9 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
 	amdgpu_ring_emit_wreg(ring, hub->ctx0_ptb_addr_hi32 + (2 * vmid),
 			      upper_32_bits(pd_addr));
 
-	amdgpu_ring_emit_wreg(ring, hub->vm_inv_eng0_req + eng, req);
-
-	/* wait for the invalidate to complete */
-	amdgpu_ring_emit_reg_wait(ring, hub->vm_inv_eng0_ack + eng,
-				  1 << vmid, 1 << vmid);
+	amdgpu_ring_emit_reg_write_reg_wait(ring, hub->vm_inv_eng0_req + eng,
+					    hub->vm_inv_eng0_ack + eng,
+					    req, 1 << vmid);
 
 	return pd_addr;
 }
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#8 lore raw

PATCH 7/8 Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang""

In reply to a message not in the archive

This reverts commit 5044a9e3253d089cf195fc3d52da5b5234f950ec. The vega10 sriov still need these patches.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -8
index dd98d2e..03a36cb 100644
@@ -1171,13 +1171,6 @@ static void sdma_v4_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
 	sdma_v4_0_wait_reg_mem(ring, 0, 0, reg, 0, val, mask, 10);
 }
 
-static void sdma_v4_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
-						   uint32_t reg0, uint32_t reg1,
-						   uint32_t ref, uint32_t mask)
-{
-	sdma_v4_0_wait_reg_mem(ring, 0, 1, reg0, reg1, ref, mask, 10);
-}
-
 static int sdma_v4_0_early_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1618,7 +1611,7 @@ static const struct amdgpu_ring_funcs sdma_v4_0_ring_funcs = {
 	.pad_ib = sdma_v4_0_ring_pad_ib,
 	.emit_wreg = sdma_v4_0_ring_emit_wreg,
 	.emit_reg_wait = sdma_v4_0_ring_emit_reg_wait,
-	.emit_reg_write_reg_wait = sdma_v4_0_ring_emit_reg_write_reg_wait,
+	.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
 };
 
 static void sdma_v4_0_set_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#9 lore raw

PATCH 8/8 drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

In reply to a message not in the archive

This adds support for writing and reading back in a single oneshot packet. This is needed to send a tlb invalidation and wait for ack in a single operation.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +15 -0
index 9d39fd5..e699b9e 100644
@@ -4137,6 +4137,18 @@ static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
 	gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20);
 }
 
+static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
+						  uint32_t reg0, uint32_t reg1,
+						  uint32_t ref, uint32_t mask)
+{
+	if (amdgpu_sriov_vf(ring->adev) && (ring->adev->asic_type == CHIP_VEGA10)) {
+		int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+		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,
 						 enum amdgpu_interrupt_state state)
 {
@@ -4458,6 +4470,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = {
 	.emit_tmz = gfx_v9_0_ring_emit_tmz,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
@@ -4492,6 +4505,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
 	.set_priority = gfx_v9_0_ring_set_priority_compute,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
@@ -4522,6 +4536,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
 	.emit_rreg = gfx_v9_0_ring_emit_rreg,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev)
Signature · 6 lines
2.7.4

_______________________________________________
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): 1522746482-31353-9-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#11 lore raw

Re: [PATCH 8/8] drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

Quoted 19 lines · Emily Deng

This adds support for writing and reading back in a single oneshot packet. This is needed to send a tlb invalidation and wait for ack in a single operation.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -0
index 9d39fd5..e699b9e 100644
@@ -4137,6 +4137,18 @@ static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
 	gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20);
 }
 
+static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg, · line 4150

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +10 -0
+						  uint32_t reg0, uint32_t reg1,
+						  uint32_t ref, uint32_t mask)
+{
+	if (amdgpu_sriov_vf(ring->adev) && (ring->adev->asic_type == CHIP_VEGA10)) {
+		int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+		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);
+	}
+}

+ Christian, Tom, I think this is the root cause for regression of raven. Alex, we need write "1" to set eng_sel field on gfx ring with below patch that based on you previous patch set. I just verified it, the gfx ring stall is gone.

Thanks,
Ray

8<-----

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -1
index ccacc7d22..2fbb6e4 100644
@@ -4134,7 +4134,9 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
                                                  uint32_t reg0, uint32_t reg1,
                                                  uint32_t ref, uint32_t mask)
 {
-       gfx_v9_0_wait_reg_mem(ring, 0, 0, 1, reg0, reg1, ref, mask, 0x20);
+       int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+
+       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
 }
 
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

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

#12 lore raw

Re: [PATCH 8/8] drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

Am 03.04.2018 um 12:55 schrieb Huang Rui:

Quoted 19 lines · Emily Deng
Quoted 18 lines

This adds support for writing and reading back in a single oneshot packet. This is needed to send a tlb invalidation and wait for ack in a single operation.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index 9d39fd5..e699b9e 100644
@@ -4137,6 +4137,18 @@ static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
  	gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20);
  }
 
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg, · line 4150

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11 -0
+static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
+						  uint32_t reg0, uint32_t reg1,
+						  uint32_t ref, uint32_t mask)
+{
+	if (amdgpu_sriov_vf(ring->adev) && (ring->adev->asic_type == CHIP_VEGA10)) {
+		int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+		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);
+	}
+}

+ Christian, Tom, I think this is the root cause for regression of raven. Alex, we need write "1" to set eng_sel field on gfx ring with below patch that based on you previous patch set. I just verified it, the gfx ring stall is gone.

Good catch, Tom can you verify that?

If that works we could keep the patches until we have the proper RLC fix for the issue.

Christian.

Quoted 12 lines

Thanks,
Ray

8<-----

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index ccacc7d22..2fbb6e4 100644

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, · line 4142

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -1
@@ -4134,7 +4134,9 @@ static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
                                                   uint32_t reg0, uint32_t reg1,
                                                   uint32_t ref, uint32_t mask)
  {
-       gfx_v9_0_wait_reg_mem(ring, 0, 0, 1, reg0, reg1, ref, mask, 0x20);
+       int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+
+       gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
  }
 
  static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

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

#13 lore raw
In reply to a message not in the archive
Quoted 18 lines · Emily Deng

For vega10 sriov, still need to use one package for invalidate tlb flush

Emily Deng (8):
Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/sdma4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/uvd7: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vce4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vcn1: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/gmc9: use
amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush""
Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang"" drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

'Revert "Revert "...""' is pretty ugly, better to use the original commit logs again (possibly with amendments explaining why they're being applied gain).

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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): 8abf4f42-54be-4b1c-6208-80ab8c40fe0a-otUistvHUpPR7s880joybQ@public.gmane.org

#15 lore raw
Quoted 20 lines · Michel Dänzer
Quoted 18 lines · Emily Deng

For vega10 sriov, still need to use one package for invalidate tlb flush

Emily Deng (8):
Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/sdma4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/uvd7: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vce4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vcn1: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/gmc9: use
amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush""
Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang"" drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

Quoted 3 lines

'Revert "Revert "...""' is pretty ugly, better to use the original commit logs again (possibly with amendments explaining why they're being applied gain).

I agree. If the fix from Ray fixes the hangs on gfx, please just generate new patches by cherry-picking the originals and squashing in any fixes and updating the commit messages if necessary. E.g., you can squash your sdma4 fix into the original sdma4 patch.

Thanks,

Alex
_______________________________________________
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): CADnq5_OLEhT1qA6iDHx6NpKfkCAnAgL=GA0LZ-=NhXt1idO0Mg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#17 lore raw

Thanks all, I will change the patches as you sugestion, and send to you review again.

Quoted 33 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Tuesday, April 03, 2018 11:07 PM
To: Michel Dänzer <[email protected]>
Cc: Deng, Emily <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH 0/8] The vega10 sriov still need those patches

Quoted 20 lines · Michel Dänzer
Quoted 18 lines · Emily Deng

For vega10 sriov, still need to use one package for invalidate tlb flush

Emily Deng (8):
Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/sdma4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/uvd7: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vce4: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/vcn1: add emit_reg_write_reg_wait ring
callback""
Revert "Revert "drm/amdgpu/gmc9: use
amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush""
Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang"" drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback

Quoted 3 lines

'Revert "Revert "...""' is pretty ugly, better to use the original commit logs again (possibly with amendments explaining why they're being applied gain).

Quoted 8 lines

I agree. If the fix from Ray fixes the hangs on gfx, please just generate new patches by cherry-picking the originals and squashing in any fixes and updating the commit messages if necessary. E.g., you can squash your sdma4 fix into the original sdma4 patch.

Thanks,

Alex

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