Skip to contentSkip to conversation

drm/amdgpu: enable 48-bit IH timestamp counter

PATCH In review Alex Sierra 4 participants 6 messages Nov 10, 2020 – Nov 14, 2020

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

PATCH 1/1 drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter. This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration. Apparently there's a problem when the timestamp coming from IH overflows and compares against timestamp coming from the the hash table.
This patch only extends the time overflow from 10 minutes to aprx 455 days.

---
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +6 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
 	if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 		if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
 			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 			if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
 						ih_rb_cntl)) {
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
 			if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
 						ih_rb_cntl)) {
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +6 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)
 
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
 	if (amdgpu_sriov_vf(adev)) {
 		if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
 			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev)) {
 			if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
 						ih_rb_cntl)) {
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev)) {
 			if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
 						ih_rb_cntl)) {
Signature · 6 lines
2.17.1

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

[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

Quoted 103 lines

-----Original Message-----
From: Sierra Guiza, Alejandro (Alex) <[email protected]>
Sent: Tuesday, November 10, 2020 11:55 AM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Sierra Guiza, Alejandro (Alex) <[email protected]>
Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from IH overflows and compares against timestamp coming from the the hash table. This patch only extends the time overflow from 10 minutes to aprx 455 days.

---
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
 	if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
 			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
 						ih_rb_cntl)) {
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING2,

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +0 -0
 						ih_rb_cntl)) {
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
 	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
 	if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
 			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
 						ih_rb_cntl)) {
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
 					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
 		if (amdgpu_sriov_vf(adev)) {
Quoted 5 lines

if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
--
2.17.1

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

#2 lore raw

Feel free to keep my rb for this, but is 455 days enough in general or should we add wrap around handling?

Christian.

Am 10.11.20 um 18:57 schrieb Sierra Guiza, Alejandro (Alex):

Quoted 111 lines

[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

Quoted 104 lines

-----Original Message-----
From: Sierra Guiza, Alejandro (Alex) <[email protected]>
Sent: Tuesday, November 10, 2020 11:55 AM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Sierra Guiza, Alejandro (Alex) <[email protected]>
Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from IH overflows and compares against timestamp coming from the the hash table. This patch only extends the time overflow from 10 minutes to aprx 455 days.

---
  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
  	if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
  	if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp,

Quoted 8 lines
Quoted 4 lines

PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
--
2.17.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

#3 lore raw

[AMD Public Use]

This give us time for the rest of the enablement we're doing. However, we should fix the fundamental problem in the near future.

Regards,
Alejandro S.

Quoted 154 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, November 16, 2020 5:31 AM
To: Sierra Guiza, Alejandro (Alex) <[email protected]>; amd- [email protected]; Koenig, Christian <[email protected]>
Cc: Kuehling, Felix <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

Feel free to keep my rb for this, but is 455 days enough in general or should we add wrap around handling?

Christian.

Am 10.11.20 um 18:57 schrieb Sierra Guiza, Alejandro (Alex):

Quoted 21 lines

[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

Quoted 14 lines

-----Original Message-----
From: Sierra Guiza, Alejandro (Alex) <[email protected]>
Sent: Tuesday, November 10, 2020 11:55 AM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Sierra Guiza, Alejandro (Alex) <[email protected]>
Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter. This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from IH overflows and compares against timestamp coming from the the hash

table.

Quoted 1 line
Quoted 1 line

This patch only extends the time overflow from 10 minutes to aprx 455

days.

Quoted 15 lines
Quoted 15 lines
---
  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +0 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
  	if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

@@ -109,6 +111,8

Quoted 3 lines
Quoted 3 lines

@@ static void navi10_ih_enable_interrupts(struct amdgpu_device *adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,

mmIH_RB_CNTL_RING1);

Quoted 4 lines
Quoted 4 lines

ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
RB_ENABLE, 1);

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/navi10_ih.c static void navi10_ih_enable_interrupts(struct · line 130

Quoted 8 lines

if (amdgpu_sriov_vf(adev) && adev->asic_type <
CHIP_NAVI10) {
if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +0 -0
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,

mmIH_RB_CNTL_RING2);

Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev) && adev->asic_type <
 CHIP_NAVI10) {

if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
  	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+				   RB_GPU_TS_ENABLE, 1);
  	if (amdgpu_sriov_vf(adev)) {

if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

(quoted diff) +0 -0
@@ -64,6 +66,8 @@
Quoted 3 lines
Quoted 3 lines

static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,

mmIH_RB_CNTL_RING1);

Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static void vega10_ih_enable_interrupts(struct · line 85

Quoted 11 lines

ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
RB_ENABLE, 1);

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev)) {
  			if (psp_reg_program(&adev->psp,

PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
  		ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,

mmIH_RB_CNTL_RING2);

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
  					   RB_ENABLE, 1);
+		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+					   RB_GPU_TS_ENABLE, 1);
  		if (amdgpu_sriov_vf(adev)) {
  			if (psp_reg_program(&adev->psp,

PSP_REG_IH_RB_CNTL_RING2,

Quoted 8 lines
Quoted 3 lines

ih_rb_cntl)) {
--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-

gfx&amp;data=04%7C01%7Cal

Quoted 1 line

ex.sierra%40amd.com%7C2fd98389222842a15da008d887e93049%7C3dd8961f e4884

Quoted 1 line

e608e11a82d994e183d%7C0%7C0%7C637408783493249465%7CUnknown%7C TWFpbGZsb

Quoted 1 line

3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 %3D%

Quoted 1 line

7C3000&amp;sdata=NyKN4mVAmDfq4zFl5rbuth551l8nYyQh2LQ3icSXojM%3 D&amp;re

Quoted 1 line

served=0

Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
freedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=04%7C01%7Calex.sierra%40amd.com%7C2fd98389222842a15 da008d887e93049%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63 7408783493249465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata= NyKN4mVAmDfq4zFl5rbuth551l8nYyQh2LQ3icSXojM%3D&amp;reserved=0

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

#4 lore raw
In reply to Christian König

I'd feel better with wrap-around handling. I think having a system up for that long is not likely but not impossible. Having a known hard limit on uptime is probably a bad thing. Imagine someone trying to reproduce the problem ...

Regards,
  Felix

Am 2020-11-16 um 6:31 a.m. schrieb Christian König:

Quoted 129 lines

Feel free to keep my rb for this, but is 455 days enough in general or should we add wrap around handling?

Christian.

Am 10.11.20 um 18:57 schrieb Sierra Guiza, Alejandro (Alex):

Quoted 113 lines

[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

Quoted 106 lines

-----Original Message-----
From: Sierra Guiza, Alejandro (Alex) <[email protected]>
Sent: Tuesday, November 10, 2020 11:55 AM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Sierra Guiza, Alejandro (Alex) <[email protected]>
Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from IH overflows
and compares against timestamp coming from the the hash table. This patch only extends the time overflow from 10 minutes to aprx 455 days.

---
  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++

  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+    ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+                   RB_GPU_TS_ENABLE, 1);
       if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {

          if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
              DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+                       RB_GPU_TS_ENABLE, 1);

          if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
              if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+                       RB_GPU_TS_ENABLE, 1);

          if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {
              if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+    ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+                   RB_GPU_TS_ENABLE, 1);
       if (amdgpu_sriov_vf(adev)) {

          if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
              DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev)) {

              if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev)) {

              if (psp_reg_program(&adev->psp,

Quoted 9 lines
Quoted 4 lines

PSP_REG_IH_RB_CNTL_RING2,
                          ih_rb_cntl)) {

Signature · 1 line
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cfelix.kuehling%40amd.com%7C2227acf915064b27b07c08d887e93027%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408782891525552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=E482HSkR2W3XrGRFNd5%2FbY1vrR5H7DmoAqwMhDfP%2FM0%3D&amp;reserved=0

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cfelix.kuehling%40amd.com%7C2227acf915064b27b07c08d887e93027%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408782891535517%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7oJGQTnBArrurCsXNog0RW6rdzZi3ANZOVOAH8UW7i0%3D&amp;reserved=0

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

maintainer
#5 lore raw

Yes, exactly.

Is the timer guaranteed to monotonous increment? I strongly suspect yes and then a simple "if (old > new) ++upper_32_bits;" should be sufficient.

Regards,
Christian.

Am 13.11.20 um 18:15 schrieb Felix Kuehling:

Quoted 5 lines

I'd feel better with wrap-around handling. I think having a system up for that long is not likely but not impossible. Having a known hard limit on uptime is probably a bad thing. Imagine someone trying to reproduce the problem ...

Quoted 137 lines

Regards,
  Felix

Am 2020-11-16 um 6:31 a.m. schrieb Christian König:

Quoted 133 lines

Feel free to keep my rb for this, but is 455 days enough in general or should we add wrap around handling?

Christian.

Am 10.11.20 um 18:57 schrieb Sierra Guiza, Alejandro (Alex):

Quoted 113 lines

[AMD Public Use]

I just added support for vega10_ih too.

Regards,
Alex

Quoted 106 lines

-----Original Message-----
From: Sierra Guiza, Alejandro (Alex) <[email protected]>
Sent: Tuesday, November 10, 2020 11:55 AM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Sierra Guiza, Alejandro (Alex) <[email protected]>
Subject: [PATCH] drm/amdgpu: enable 48-bit IH timestamp counter

By default this timestamp is based on a 32 bit counter.
This is used by the amdgpu_gmc_filter_faults, to avoid process the same interrupt in retry configuration.
Apparently there's a problem when the timestamp coming from IH overflows
and compares against timestamp coming from the the hash table. This patch only extends the time overflow from 10 minutes to aprx 455 days.

---
   drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 6 ++++++
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 6 ++++++
   2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
index 837769fcb35b..bda916f33805 100644
@@ -94,6 +94,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+    ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+                   RB_GPU_TS_ENABLE, 1);
       if (amdgpu_sriov_vf(adev) && adev->asic_type < CHIP_NAVI10) {

          if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
              DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -109,6 +111,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
              if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/navi10_ih.c +2 -0
@@ -125,6 +129,8 @@ static void navi10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev) && adev->asic_type <

CHIP_NAVI10) {
              if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING2,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
index 407c6093c2ec..35d68bc5d95e 100644
@@ -50,6 +50,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
 
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
       ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR,
 1);
+    ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
+                   RB_GPU_TS_ENABLE, 1);
       if (amdgpu_sriov_vf(adev)) {

          if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL,
ih_rb_cntl)) {
              DRM_ERROR("PSP program IH_RB_CNTL failed!\n");

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -64,6 +66,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING1);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev)) {

              if (psp_reg_program(&adev->psp,
PSP_REG_IH_RB_CNTL_RING1,
                          ih_rb_cntl)) {

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +2 -0
@@ -80,6 +84,8 @@ static void vega10_ih_enable_interrupts(struct
 amdgpu_device *adev)
           ih_rb_cntl = RREG32_SOC15(OSSSYS, 0,
 mmIH_RB_CNTL_RING2);
           ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
                          RB_ENABLE, 1);
+        ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
+                       RB_GPU_TS_ENABLE, 1);
           if (amdgpu_sriov_vf(adev)) {

              if (psp_reg_program(&adev->psp,

Quoted 9 lines
Quoted 4 lines

PSP_REG_IH_RB_CNTL_RING2,
                          ih_rb_cntl)) {

Signature · 1 line
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cfelix.kuehling%40amd.com%7C2227acf915064b27b07c08d887e93027%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408782891525552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=E482HSkR2W3XrGRFNd5%2FbY1vrR5H7DmoAqwMhDfP%2FM0%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cfelix.kuehling%40amd.com%7C2227acf915064b27b07c08d887e93027%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637408782891535517%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7oJGQTnBArrurCsXNog0RW6rdzZi3ANZOVOAH8UW7i0%3D&amp;reserved=0

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