Skip to contentSkip to conversation

drm/amdgpu: change Vega IH ring 1 config

PATCH In review Christian König 3 participants 6 messages Mar 4, 2019 – Mar 6, 2019 2 messages not in the archive

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

PATCH 1/3 drm/amdgpu: change Vega IH ring 1 config

Disable overflow and enable full drain. This makes fault handling on ring 1 much more reliable since we don't generate back pressure any more.

---
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +4 -0
index 6d1f804277f8..d4a3cc413af8 100644
@@ -203,6 +203,10 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev)
 
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   WPTR_OVERFLOW_ENABLE, 0);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   RB_FULL_DRAIN_ENABLE, 1);
 		WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
 
 		/* set rptr, wptr to 0 */
Signature · 6 lines
2.17.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): 20190304191027.1792-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/3 drm/amdgpu: enable IH doorbell for ring 1&2 on Vega

The doorbells should already be reserved, just enable them.

---
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  3 +-
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 66 +++++++++++++++++---------
 2 files changed, 45 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +2 -1
index cc967dbfd631..6590143c3f75 100644
@@ -118,7 +118,8 @@ static void nbio_v6_1_ih_doorbell_range(struct amdgpu_device *adev,
 
 	if (use_doorbell) {
 		ih_doorbell_range = REG_SET_FIELD(ih_doorbell_range, BIF_IH_DOORBELL_RANGE, OFFSET, doorbell_index);
-		ih_doorbell_range = REG_SET_FIELD(ih_doorbell_range, BIF_IH_DOORBELL_RANGE, SIZE, 2);
+		ih_doorbell_range = REG_SET_FIELD(ih_doorbell_range,
+						  BIF_IH_DOORBELL_RANGE, SIZE, 6);
 	} else
 		ih_doorbell_range = REG_SET_FIELD(ih_doorbell_range, BIF_IH_DOORBELL_RANGE, SIZE, 0);
 
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +43 -23

120 lines not on this page · raw message

Signature · 6 lines
2.17.1

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

PATCH 3/3 drm/amdgpu: enable IH ring 1&2 for Vega20 as well

In reply to a message not in the archive

That doesn't seem to have any negative effects.

---
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 30 +++++++++++---------------
 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +13 -17
index fa45234f020f..1b2f69a9a24e 100644
@@ -469,23 +469,19 @@ static int vega10_ih_sw_init(void *handle)
 	adev->irq.ih.use_doorbell = true;
 	adev->irq.ih.doorbell_index = adev->doorbell_index.ih << 1;
 
-	if (adev->asic_type == CHIP_VEGA10) {
-		r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);
-		if (r)
-			return r;
-
-		adev->irq.ih1.use_doorbell = true;
-		adev->irq.ih1.doorbell_index =
-			(adev->doorbell_index.ih + 1) << 1;
-
-		r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
-		if (r)
-			return r;
-
-		adev->irq.ih2.use_doorbell = true;
-		adev->irq.ih2.doorbell_index =
-			(adev->doorbell_index.ih + 2) << 1;
-	}
+	r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);
+	if (r)
+		return r;
+
+	adev->irq.ih1.use_doorbell = true;
+	adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;
+
+	r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
+	if (r)
+		return r;
+
+	adev->irq.ih2.use_doorbell = true;
+	adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
 
 	r = amdgpu_irq_init(adev);
 
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw
In reply to a message not in the archive

Ping? Can anybody review this?

Thanks,
Christian.

Am 04.03.19 um 20:10 schrieb Christian König:

Quoted 13 lines

Disable overflow and enable full drain. This makes fault handling on ring 1 much more reliable since we don't generate back pressure any more.

---
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 6d1f804277f8..d4a3cc413af8 100644

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static int vega10_ih_irq_init(struct amdgpu_device *adev) · line 212

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +4 -0
@@ -203,6 +203,10 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev)
 
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
  		ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   WPTR_OVERFLOW_ENABLE, 0);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   RB_FULL_DRAIN_ENABLE, 1);
  		WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
 
  		/* set rptr, wptr to 0 */

_______________________________________________
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): d2e841e5-8c65-c46b-1346-d3cc96584f61-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Acked-by Chunming Zhou
#6 lore raw
Quoted 39 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian K?nig
Sent: Wednesday, March 06, 2019 5:29 PM
To: [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: change Vega IH ring 1 config

Ping? Can anybody review this?

Thanks,
Christian.

Am 04.03.19 um 20:10 schrieb Christian König:

Quoted 14 lines

Disable overflow and enable full drain. This makes fault handling on ring 1 much more reliable since we don't generate back pressure any more.

---
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 6d1f804277f8..d4a3cc413af8 100644

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static int vega10_ih_irq_init(struct · line 205

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
@@ -203,6 +203,10 @@ static int vega10_ih_irq_init(struct
 amdgpu_device *adev)
 
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,

mmIH_RB_CNTL_RING1);

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static int vega10_ih_irq_init(struct amdgpu_device *adev)

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +4 -0
  		ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   WPTR_OVERFLOW_ENABLE, 0);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+					   RB_FULL_DRAIN_ENABLE, 1);
  		WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1,

ih_rb_cntl);

Quoted 1 line
Quoted 6 lines
Quoted 1 line

/* set rptr, wptr to 0 */

_______________________________________________
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

#7 lore raw
In reply to a message not in the archive

Copied register definitions below. I guess with this change, you changed how the IH block treat new interrupt when ring is full. Before this change, IH keep new interrupt in the ring and overwrite oldest interrupt. After your change, IH will simply drop new interrupt and keep old interrupt in the ring (keep wptr unchanged).

Is above understanding correct? If yes, can you explain why the new scheme is more reliable? If this is more reliable, should we use this scheme for all 3 interrupt ring?

RB_FULL_DRAIN_ENABLE

9

0x0

When Ring Buffer is full, this enables draining of interrupts to prevent back pressure to IH clients.
POSSIBLE VALUES:
00 - Disable

WPTR_OVERFLOW_ENABLE

16

0x1

Ring Buffer write pointer overflow.
POSSIBLE VALUES:
00 - Disable
01 - Enable

Regards,

Oak

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Wednesday, March 6, 2019 4:29 AM
To: [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: change Vega IH ring 1 config

Ping? Can anybody review this?

Thanks,

Christian.

Am 04.03.19 um 20:10 schrieb Christian König:

Quoted 39 lines

Disable overflow and enable full drain. This makes fault handling on

ring 1 much more reliable since we don't generate back pressure any more.

---

  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 4 ++++
  1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c

index 6d1f804277f8..d4a3cc413af8 100644

--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c

+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c

(quoted diff) +2 -0
@@ -203,6 +203,10 @@ static int vega10_ih_irq_init(struct
 
 amdgpu_device *adev)
 
 
 
                           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
 
                           ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
 
+                         ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
 
+                                                                         WPTR_OVERFLOW_ENABLE, 0);

Review static int vega10_ih_irq_init(struct

Quoted 10 lines
(quoted diff) +2 -0
 
+                         ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
 
+                                                                         RB_FULL_DRAIN_ENABLE, 1);
 
                           WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
 
 
 
                           /* set rptr, wptr to 0 */

_______________________________________________

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