AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set
@ 2022-09-28 15:21 Graham Sider
  2022-09-28 19:03 ` Alex Deucher
  2022-09-28 19:09 ` Felix Kuehling
  0 siblings, 2 replies; 3+ messages in thread
From: Graham Sider @ 2022-09-28 15:21 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, Harish.Kasiviswanathan, Graham Sider

Simplify the logic in amdgpu_gmc_noretry_set by getting rid of the
switch. Also set noretry=1 as default for GFX 10.3.0 and greater since
retry faults are not supported.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 48 +++++--------------------
 1 file changed, 9 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index aebc384531ac..34233a74248c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -572,45 +572,15 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
 void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 {
 	struct amdgpu_gmc *gmc = &adev->gmc;
-
-	switch (adev->ip_versions[GC_HWIP][0]) {
-	case IP_VERSION(9, 0, 1):
-	case IP_VERSION(9, 3, 0):
-	case IP_VERSION(9, 4, 0):
-	case IP_VERSION(9, 4, 1):
-	case IP_VERSION(9, 4, 2):
-	case IP_VERSION(10, 3, 3):
-	case IP_VERSION(10, 3, 4):
-	case IP_VERSION(10, 3, 5):
-	case IP_VERSION(10, 3, 6):
-	case IP_VERSION(10, 3, 7):
-		/*
-		 * noretry = 0 will cause kfd page fault tests fail
-		 * for some ASICs, so set default to 1 for these ASICs.
-		 */
-		if (amdgpu_noretry == -1)
-			gmc->noretry = 1;
-		else
-			gmc->noretry = amdgpu_noretry;
-		break;
-	default:
-		/* Raven currently has issues with noretry
-		 * regardless of what we decide for other
-		 * asics, we should leave raven with
-		 * noretry = 0 until we root cause the
-		 * issues.
-		 *
-		 * default this to 0 for now, but we may want
-		 * to change this in the future for certain
-		 * GPUs as it can increase performance in
-		 * certain cases.
-		 */
-		if (amdgpu_noretry == -1)
-			gmc->noretry = 0;
-		else
-			gmc->noretry = amdgpu_noretry;
-		break;
-	}
+	uint32_t gc_ver = adev->ip_versions[GC_HWIP][0];
+	bool noretry_default = (gc_ver == IP_VERSION(9, 0, 1) ||
+				gc_ver == IP_VERSION(9, 3, 0) ||
+				gc_ver == IP_VERSION(9, 4, 0) ||
+				gc_ver == IP_VERSION(9, 4, 1) ||
+				gc_ver == IP_VERSION(9, 4, 2) ||
+				gc_ver >= IP_VERSION(10, 3, 0));
+
+	gmc->noretry = (amdgpu_noretry == -1) ? noretry_default : amdgpu_noretry;
 }
 
 void amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set
  2022-09-28 15:21 [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set Graham Sider
@ 2022-09-28 19:03 ` Alex Deucher
  2022-09-28 19:09 ` Felix Kuehling
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2022-09-28 19:03 UTC (permalink / raw)
  To: Graham Sider; +Cc: Felix.Kuehling, Harish.Kasiviswanathan, amd-gfx

On Wed, Sep 28, 2022 at 11:22 AM Graham Sider <Graham.Sider@amd.com> wrote:
>
> Simplify the logic in amdgpu_gmc_noretry_set by getting rid of the
> switch. Also set noretry=1 as default for GFX 10.3.0 and greater since
> retry faults are not supported.
>
> Signed-off-by: Graham Sider <Graham.Sider@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 48 +++++--------------------
>  1 file changed, 9 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index aebc384531ac..34233a74248c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -572,45 +572,15 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
>  void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
>  {
>         struct amdgpu_gmc *gmc = &adev->gmc;
> -
> -       switch (adev->ip_versions[GC_HWIP][0]) {
> -       case IP_VERSION(9, 0, 1):
> -       case IP_VERSION(9, 3, 0):
> -       case IP_VERSION(9, 4, 0):
> -       case IP_VERSION(9, 4, 1):
> -       case IP_VERSION(9, 4, 2):
> -       case IP_VERSION(10, 3, 3):
> -       case IP_VERSION(10, 3, 4):
> -       case IP_VERSION(10, 3, 5):
> -       case IP_VERSION(10, 3, 6):
> -       case IP_VERSION(10, 3, 7):
> -               /*
> -                * noretry = 0 will cause kfd page fault tests fail
> -                * for some ASICs, so set default to 1 for these ASICs.
> -                */
> -               if (amdgpu_noretry == -1)
> -                       gmc->noretry = 1;
> -               else
> -                       gmc->noretry = amdgpu_noretry;
> -               break;
> -       default:
> -               /* Raven currently has issues with noretry
> -                * regardless of what we decide for other
> -                * asics, we should leave raven with
> -                * noretry = 0 until we root cause the
> -                * issues.
> -                *
> -                * default this to 0 for now, but we may want
> -                * to change this in the future for certain
> -                * GPUs as it can increase performance in
> -                * certain cases.
> -                */
> -               if (amdgpu_noretry == -1)
> -                       gmc->noretry = 0;
> -               else
> -                       gmc->noretry = amdgpu_noretry;
> -               break;
> -       }
> +       uint32_t gc_ver = adev->ip_versions[GC_HWIP][0];
> +       bool noretry_default = (gc_ver == IP_VERSION(9, 0, 1) ||
> +                               gc_ver == IP_VERSION(9, 3, 0) ||
> +                               gc_ver == IP_VERSION(9, 4, 0) ||
> +                               gc_ver == IP_VERSION(9, 4, 1) ||
> +                               gc_ver == IP_VERSION(9, 4, 2) ||
> +                               gc_ver >= IP_VERSION(10, 3, 0));
> +
> +       gmc->noretry = (amdgpu_noretry == -1) ? noretry_default : amdgpu_noretry;
>  }
>
>  void amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type,
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set
  2022-09-28 15:21 [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set Graham Sider
  2022-09-28 19:03 ` Alex Deucher
@ 2022-09-28 19:09 ` Felix Kuehling
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2022-09-28 19:09 UTC (permalink / raw)
  To: Graham Sider, amd-gfx; +Cc: Harish.Kasiviswanathan

Am 2022-09-28 um 11:21 schrieb Graham Sider:
> Simplify the logic in amdgpu_gmc_noretry_set by getting rid of the
> switch. Also set noretry=1 as default for GFX 10.3.0 and greater since
> retry faults are not supported.
>
> Signed-off-by: Graham Sider <Graham.Sider@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 48 +++++--------------------
>   1 file changed, 9 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index aebc384531ac..34233a74248c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -572,45 +572,15 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
>   void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
>   {
>   	struct amdgpu_gmc *gmc = &adev->gmc;
> -
> -	switch (adev->ip_versions[GC_HWIP][0]) {
> -	case IP_VERSION(9, 0, 1):
> -	case IP_VERSION(9, 3, 0):
> -	case IP_VERSION(9, 4, 0):
> -	case IP_VERSION(9, 4, 1):
> -	case IP_VERSION(9, 4, 2):
> -	case IP_VERSION(10, 3, 3):
> -	case IP_VERSION(10, 3, 4):
> -	case IP_VERSION(10, 3, 5):
> -	case IP_VERSION(10, 3, 6):
> -	case IP_VERSION(10, 3, 7):
> -		/*
> -		 * noretry = 0 will cause kfd page fault tests fail
> -		 * for some ASICs, so set default to 1 for these ASICs.
> -		 */
> -		if (amdgpu_noretry == -1)
> -			gmc->noretry = 1;
> -		else
> -			gmc->noretry = amdgpu_noretry;
> -		break;
> -	default:
> -		/* Raven currently has issues with noretry
> -		 * regardless of what we decide for other
> -		 * asics, we should leave raven with
> -		 * noretry = 0 until we root cause the
> -		 * issues.
> -		 *
> -		 * default this to 0 for now, but we may want
> -		 * to change this in the future for certain
> -		 * GPUs as it can increase performance in
> -		 * certain cases.
> -		 */
> -		if (amdgpu_noretry == -1)
> -			gmc->noretry = 0;
> -		else
> -			gmc->noretry = amdgpu_noretry;
> -		break;
> -	}
> +	uint32_t gc_ver = adev->ip_versions[GC_HWIP][0];
> +	bool noretry_default = (gc_ver == IP_VERSION(9, 0, 1) ||
> +				gc_ver == IP_VERSION(9, 3, 0) ||
> +				gc_ver == IP_VERSION(9, 4, 0) ||
> +				gc_ver == IP_VERSION(9, 4, 1) ||
> +				gc_ver == IP_VERSION(9, 4, 2) ||
> +				gc_ver >= IP_VERSION(10, 3, 0));
> +
> +	gmc->noretry = (amdgpu_noretry == -1) ? noretry_default : amdgpu_noretry;
>   }
>   
>   void amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-28 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28 15:21 [PATCH] drm/amdgpu: remove switch from amdgpu_gmc_noretry_set Graham Sider
2022-09-28 19:03 ` Alex Deucher
2022-09-28 19:09 ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox