Skip to contentSkip to conversation

drm/amdgpu: move amdgpu_gmc_noretry_set after ip_versions populated

PATCH In review Yifan Zhang 6 participants 9 messages Mar 1, 2022 – Mar 2, 2022

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

PATCH v2 1/3 drm/amdgpu: move amdgpu_gmc_noretry_set after ip_versions populated

otherwise adev->ip_versions is still empty when amdgpu_gmc_noretry_set is called.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 6113ddc765a7..61a6a7920c76 100644
@@ -1554,7 +1554,6 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)
 
 	amdgpu_gmc_tmz_set(adev);
 
-	amdgpu_gmc_noretry_set(adev);
 
 	return 0;
 }
@@ -3641,6 +3640,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (r)
 		return r;
 
+	amdgpu_gmc_noretry_set(adev);
 	/* Need to get xgmi info early to decide the reset behavior*/
 	if (adev->gmc.xgmi.supported) {
 		r = adev->gfxhub.funcs->get_xgmi_info(adev);
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/3 drm/amdgpu: convert code name to ip version for noretry set

Use IP version rather than codename for noretry set.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -9
index ab75e189bc0b..fbc22b7b6315 100644
@@ -559,14 +559,14 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 {
 	struct amdgpu_gmc *gmc = &adev->gmc;
 
-	switch (adev->asic_type) {
-	case CHIP_VEGA10:
-	case CHIP_VEGA20:
-	case CHIP_ARCTURUS:
-	case CHIP_ALDEBARAN:
-	case CHIP_BEIGE_GOBY:
-	case CHIP_YELLOW_CARP:
-	case CHIP_RENOIR:
+	switch (adev->ip_versions[GC_HWIP][0]) {
+	case IP_VERSION(9, 0, 1):
+	case IP_VERSION(9, 4, 0):
+	case IP_VERSION(9, 4, 1):
+	case IP_VERSION(9, 4, 2):
+	case IP_VERSION(10, 3, 5):
+	case IP_VERSION(10, 3, 3):
+	case IP_VERSION(9, 3, 0):
 		/*
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
@@ -576,7 +576,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 		else
 			gmc->noretry = amdgpu_noretry;
 		break;
-	case CHIP_RAVEN:
 	default:
 		/* Raven currently has issues with noretry
 		 * regardless of what we decide for other
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v2 2/3] drm/amdgpu: convert code name to ip version for noretry set

Dear Yifan,

Thank you for your patch.

Am 01.03.22 um 16:01 schrieb Yifan Zhang:

Quoted 1 line

Use IP version rather than codename for noretry set.

Why?

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 17 ++++++++---------
  1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -6
index ab75e189bc0b..fbc22b7b6315 100644
@@ -559,14 +559,14 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
  {
  	struct amdgpu_gmc *gmc = &adev->gmc;
 
-	switch (adev->asic_type) {
-	case CHIP_VEGA10:
-	case CHIP_VEGA20:
-	case CHIP_ARCTURUS:
-	case CHIP_ALDEBARAN:
-	case CHIP_BEIGE_GOBY:

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 569

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -2
-	case CHIP_YELLOW_CARP:
-	case CHIP_RENOIR:
+	switch (adev->ip_versions[GC_HWIP][0]) {
+	case IP_VERSION(9, 0, 1):
+	case IP_VERSION(9, 4, 0):
+	case IP_VERSION(9, 4, 1):
+	case IP_VERSION(9, 4, 2):
+	case IP_VERSION(10, 3, 5):
+	case IP_VERSION(10, 3, 3):
+	case IP_VERSION(9, 3, 0):

I think, sorting these entries might be useful.

Should the names be added as comments for those not having them memorized?

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 579

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -1
  		/*
  		 * noretry = 0 will cause kfd page fault tests fail
  		 * for some ASICs, so set default to 1 for these ASICs.
@@ -576,7 +576,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
  		else
  			gmc->noretry = amdgpu_noretry;
  		break;
-	case CHIP_RAVEN:

Why remove this?

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 581

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
  	default:
  		/* Raven currently has issues with noretry
  		 * regardless of what we decide for other

Kind regards,

Paul

#3 lore raw

Re: [PATCH v2 2/3] drm/amdgpu: convert code name to ip version for noretry set

Am 01.03.22 um 16:24 schrieb Paul Menzel:

Quoted 9 lines

Dear Yifan,

Thank you for your patch.

Am 01.03.22 um 16:01 schrieb Yifan Zhang:

Quoted 1 line

Use IP version rather than codename for noretry set.

Why?

Why not?

Quoted 55 lines
Quoted 20 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 17 ++++++++---------

  1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -5
index ab75e189bc0b..fbc22b7b6315 100644
@@ -559,14 +559,14 @@ void amdgpu_gmc_noretry_set(struct 
 amdgpu_device *adev)
   {
       struct amdgpu_gmc *gmc = &adev->gmc;
   -    switch (adev->asic_type) {
-    case CHIP_VEGA10:
-    case CHIP_VEGA20:
-    case CHIP_ARCTURUS:
-    case CHIP_ALDEBARAN:
-    case CHIP_BEIGE_GOBY:

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct · line 570

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -2
-    case CHIP_YELLOW_CARP:
-    case CHIP_RENOIR:
+    switch (adev->ip_versions[GC_HWIP][0]) {
+    case IP_VERSION(9, 0, 1):
+    case IP_VERSION(9, 4, 0):
+    case IP_VERSION(9, 4, 1):
+    case IP_VERSION(9, 4, 2):
+    case IP_VERSION(10, 3, 5):
+    case IP_VERSION(10, 3, 3):
+    case IP_VERSION(9, 3, 0):

I think, sorting these entries might be useful.

Should the names be added as comments for those not having them memorized?

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
           /*
            * noretry = 0 will cause kfd page fault tests fail

           * for some ASICs, so set default to 1 for these ASICs.

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
@@ -576,7 +576,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device 
 *adev)

          else
              gmc->noretry = amdgpu_noretry;
          break;
-    case CHIP_RAVEN:

Why remove this?

Quoted 3 lines

      default:
          /* Raven currently has issues with noretry
           * regardless of what we decide for other

Kind regards,

Paul

#4 lore raw

Re: [PATCH v2 2/3] drm/amdgpu: convert code name to ip version for noretry set

Dear Christian,

Am 02.03.22 um 08:46 schrieb Christian König:

Quoted 1 line

Am 01.03.22 um 16:24 schrieb Paul Menzel:

[…]

Quoted 6 lines
Quoted 4 lines

Am 01.03.22 um 16:01 schrieb Yifan Zhang:

Quoted 1 line

Use IP version rather than codename for noretry set.

Why?

Why not?

No idea as the commit message currently does not document the motivation.

Quoted 46 lines
Quoted 46 lines
Quoted 19 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 17 ++++++++---------

  1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -5
index ab75e189bc0b..fbc22b7b6315 100644
@@ -559,14 +559,14 @@ void amdgpu_gmc_noretry_set(struct 
 amdgpu_device *adev)
   {
       struct amdgpu_gmc *gmc = &adev->gmc;
   -    switch (adev->asic_type) {
-    case CHIP_VEGA10:
-    case CHIP_VEGA20:
-    case CHIP_ARCTURUS:
-    case CHIP_ALDEBARAN:
-    case CHIP_BEIGE_GOBY:

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct · line 570

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -2
-    case CHIP_YELLOW_CARP:
-    case CHIP_RENOIR:
+    switch (adev->ip_versions[GC_HWIP][0]) {
+    case IP_VERSION(9, 0, 1):
+    case IP_VERSION(9, 4, 0):
+    case IP_VERSION(9, 4, 1):
+    case IP_VERSION(9, 4, 2):
+    case IP_VERSION(10, 3, 5):
+    case IP_VERSION(10, 3, 3):
+    case IP_VERSION(9, 3, 0):

I think, sorting these entries might be useful.

Should the names be added as comments for those not having them memorized?

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
           /*
            * noretry = 0 will cause kfd page fault tests fail

           * for some ASICs, so set default to 1 for these ASICs.

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
@@ -576,7 +576,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device 
 *adev)

          else
              gmc->noretry = amdgpu_noretry;
          break;
-    case CHIP_RAVEN:

Why remove this?

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

      default:
          /* Raven currently has issues with noretry
           * regardless of what we decide for other

Kind regards,

Paul

maintainer
#5 lore raw

Re: [PATCH v2 2/3] drm/amdgpu: convert code name to ip version for noretry set

In reply to Yifan Zhang

Am 01.03.22 um 16:01 schrieb Yifan Zhang:

Quoted 21 lines

Use IP version rather than codename for noretry set.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 17 ++++++++---------
  1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -6
index ab75e189bc0b..fbc22b7b6315 100644
@@ -559,14 +559,14 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
  {
  	struct amdgpu_gmc *gmc = &adev->gmc;
 
-	switch (adev->asic_type) {
-	case CHIP_VEGA10:
-	case CHIP_VEGA20:
-	case CHIP_ARCTURUS:
-	case CHIP_ALDEBARAN:
-	case CHIP_BEIGE_GOBY:

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 569

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 -2
-	case CHIP_YELLOW_CARP:
-	case CHIP_RENOIR:
+	switch (adev->ip_versions[GC_HWIP][0]) {
+	case IP_VERSION(9, 0, 1):
+	case IP_VERSION(9, 4, 0):
+	case IP_VERSION(9, 4, 1):
+	case IP_VERSION(9, 4, 2):
+	case IP_VERSION(10, 3, 5):
+	case IP_VERSION(10, 3, 3):
+	case IP_VERSION(9, 3, 0):

Maybe sort those?

Apart from that Acked-by: Christian König <[email protected]>

Regards,
Christian.

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -1
  		/*
  		 * noretry = 0 will cause kfd page fault tests fail
  		 * for some ASICs, so set default to 1 for these ASICs.
@@ -576,7 +576,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
  		else
  			gmc->noretry = amdgpu_noretry;
  		break;
-	case CHIP_RAVEN:
  	default:
  		/* Raven currently has issues with noretry
  		 * regardless of what we decide for other
#6 lore raw

PATCH v2 3/3 drm/amdgpu: set noretry=1 for gc 10.3.6

In reply to Yifan Zhang

this patch to set noretry=1 for gc 10.3.6.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -0
index fbc22b7b6315..7c2a9555b7cc 100644
@@ -567,6 +567,7 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 	case IP_VERSION(10, 3, 5):
 	case IP_VERSION(10, 3, 3):
 	case IP_VERSION(9, 3, 0):
+	case IP_VERSION(10, 3, 6):
 		/*
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
Signature · 1 line
2.25.1
Reviewed-by on v2 1/3
#7 lore raw
In reply to Yifan Zhang

Series is:

Quoted 32 lines · Yifan Zhang

otherwise adev->ip_versions is still empty when amdgpu_gmc_noretry_set is called.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -2
index 6113ddc765a7..61a6a7920c76 100644
@@ -1554,7 +1554,6 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)
 
        amdgpu_gmc_tmz_set(adev);
 
-       amdgpu_gmc_noretry_set(adev);
 
        return 0;
 }
@@ -3641,6 +3640,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        if (r)
                return r;
 
+       amdgpu_gmc_noretry_set(adev);
        /* Need to get xgmi info early to decide the reset behavior*/
        if (adev->gmc.xgmi.supported) {
                r = adev->gfxhub.funcs->get_xgmi_info(adev);
--

2.25.1

#8 lore raw
In reply to Yifan Zhang
Quoted 4 lines · Yifan

otherwise adev->ip_versions is still empty when amdgpu_gmc_noretry_set is called.

Series are Reviewed-by: Huang Rui <[email protected]>

Quoted 27 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 6113ddc765a7..61a6a7920c76 100644
@@ -1554,7 +1554,6 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)
 
 	amdgpu_gmc_tmz_set(adev);
 
-	amdgpu_gmc_noretry_set(adev);
 
 	return 0;
 }
@@ -3641,6 +3640,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	if (r)
 		return r;
 
+	amdgpu_gmc_noretry_set(adev);
 	/* Need to get xgmi info early to decide the reset behavior*/
 	if (adev->gmc.xgmi.supported) {
 		r = adev->gfxhub.funcs->get_xgmi_info(adev);
Signature · 1 line
2.25.1