All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove unsed amdgpu_gem_handle_lockup
@ 2017-05-08 13:25 Christian König
       [not found] ` <1494249902-26592-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2017-05-08 13:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

This kind of reset handling was removed a long time ago.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 45 ++++++++-------------------------
 1 file changed, 11 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 67be795..28c8348 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -219,16 +219,6 @@ void amdgpu_gem_object_close(struct drm_gem_object *obj,
 	ttm_eu_backoff_reservation(&ticket, &list);
 }
 
-static int amdgpu_gem_handle_lockup(struct amdgpu_device *adev, int r)
-{
-	if (r == -EDEADLK) {
-		r = amdgpu_gpu_reset(adev);
-		if (!r)
-			r = -EAGAIN;
-	}
-	return r;
-}
-
 /*
  * GEM ioctls.
  */
@@ -249,20 +239,17 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 				      AMDGPU_GEM_CREATE_CPU_GTT_USWC |
 				      AMDGPU_GEM_CREATE_VRAM_CLEARED|
 				      AMDGPU_GEM_CREATE_SHADOW |
-				      AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) {
-		r = -EINVAL;
-		goto error_unlock;
-	}
+				      AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS))
+		return -EINVAL;
+
 	/* reject invalid gem domains */
 	if (args->in.domains & ~(AMDGPU_GEM_DOMAIN_CPU |
 				 AMDGPU_GEM_DOMAIN_GTT |
 				 AMDGPU_GEM_DOMAIN_VRAM |
 				 AMDGPU_GEM_DOMAIN_GDS |
 				 AMDGPU_GEM_DOMAIN_GWS |
-				 AMDGPU_GEM_DOMAIN_OA)) {
-		r = -EINVAL;
-		goto error_unlock;
-	}
+				 AMDGPU_GEM_DOMAIN_OA))
+		return -EINVAL;
 
 	/* create a gem object to contain this object in */
 	if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
@@ -274,10 +261,8 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 			size = size << AMDGPU_GWS_SHIFT;
 		else if (args->in.domains == AMDGPU_GEM_DOMAIN_OA)
 			size = size << AMDGPU_OA_SHIFT;
-		else {
-			r = -EINVAL;
-			goto error_unlock;
-		}
+		else
+			return -EINVAL;
 	}
 	size = roundup(size, PAGE_SIZE);
 
@@ -286,21 +271,17 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 				     args->in.domain_flags,
 				     kernel, &gobj);
 	if (r)
-		goto error_unlock;
+		return r;
 
 	r = drm_gem_handle_create(filp, gobj, &handle);
 	/* drop reference from allocate - handle holds it now */
 	drm_gem_object_unreference_unlocked(gobj);
 	if (r)
-		goto error_unlock;
+		return r;
 
 	memset(args, 0, sizeof(*args));
 	args->out.handle = handle;
 	return 0;
-
-error_unlock:
-	r = amdgpu_gem_handle_lockup(adev, r);
-	return r;
 }
 
 int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
@@ -334,7 +315,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 				     AMDGPU_GEM_DOMAIN_CPU, 0,
 				     0, &gobj);
 	if (r)
-		goto handle_lockup;
+		return r;
 
 	bo = gem_to_amdgpu_bo(gobj);
 	bo->prefered_domains = AMDGPU_GEM_DOMAIN_GTT;
@@ -374,7 +355,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 	/* drop reference from allocate - handle holds it now */
 	drm_gem_object_unreference_unlocked(gobj);
 	if (r)
-		goto handle_lockup;
+		return r;
 
 	args->handle = handle;
 	return 0;
@@ -388,9 +369,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 release_object:
 	drm_gem_object_unreference_unlocked(gobj);
 
-handle_lockup:
-	r = amdgpu_gem_handle_lockup(adev, r);
-
 	return r;
 }
 
@@ -486,7 +464,6 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
 		r = ret;
 
 	drm_gem_object_unreference_unlocked(gobj);
-	r = amdgpu_gem_handle_lockup(adev, r);
 	return r;
 }
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: remove unsed amdgpu_gem_handle_lockup
       [not found] ` <1494249902-26592-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2017-05-08 18:40   ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2017-05-08 18:40 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx list

On Mon, May 8, 2017 at 9:25 AM, Christian König <deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> This kind of reset handling was removed a long time ago.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

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

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 45 ++++++++-------------------------
>  1 file changed, 11 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 67be795..28c8348 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -219,16 +219,6 @@ void amdgpu_gem_object_close(struct drm_gem_object *obj,
>         ttm_eu_backoff_reservation(&ticket, &list);
>  }
>
> -static int amdgpu_gem_handle_lockup(struct amdgpu_device *adev, int r)
> -{
> -       if (r == -EDEADLK) {
> -               r = amdgpu_gpu_reset(adev);
> -               if (!r)
> -                       r = -EAGAIN;
> -       }
> -       return r;
> -}
> -
>  /*
>   * GEM ioctls.
>   */
> @@ -249,20 +239,17 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>                                       AMDGPU_GEM_CREATE_CPU_GTT_USWC |
>                                       AMDGPU_GEM_CREATE_VRAM_CLEARED|
>                                       AMDGPU_GEM_CREATE_SHADOW |
> -                                     AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) {
> -               r = -EINVAL;
> -               goto error_unlock;
> -       }
> +                                     AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS))
> +               return -EINVAL;
> +
>         /* reject invalid gem domains */
>         if (args->in.domains & ~(AMDGPU_GEM_DOMAIN_CPU |
>                                  AMDGPU_GEM_DOMAIN_GTT |
>                                  AMDGPU_GEM_DOMAIN_VRAM |
>                                  AMDGPU_GEM_DOMAIN_GDS |
>                                  AMDGPU_GEM_DOMAIN_GWS |
> -                                AMDGPU_GEM_DOMAIN_OA)) {
> -               r = -EINVAL;
> -               goto error_unlock;
> -       }
> +                                AMDGPU_GEM_DOMAIN_OA))
> +               return -EINVAL;
>
>         /* create a gem object to contain this object in */
>         if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
> @@ -274,10 +261,8 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>                         size = size << AMDGPU_GWS_SHIFT;
>                 else if (args->in.domains == AMDGPU_GEM_DOMAIN_OA)
>                         size = size << AMDGPU_OA_SHIFT;
> -               else {
> -                       r = -EINVAL;
> -                       goto error_unlock;
> -               }
> +               else
> +                       return -EINVAL;
>         }
>         size = roundup(size, PAGE_SIZE);
>
> @@ -286,21 +271,17 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>                                      args->in.domain_flags,
>                                      kernel, &gobj);
>         if (r)
> -               goto error_unlock;
> +               return r;
>
>         r = drm_gem_handle_create(filp, gobj, &handle);
>         /* drop reference from allocate - handle holds it now */
>         drm_gem_object_unreference_unlocked(gobj);
>         if (r)
> -               goto error_unlock;
> +               return r;
>
>         memset(args, 0, sizeof(*args));
>         args->out.handle = handle;
>         return 0;
> -
> -error_unlock:
> -       r = amdgpu_gem_handle_lockup(adev, r);
> -       return r;
>  }
>
>  int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
> @@ -334,7 +315,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>                                      AMDGPU_GEM_DOMAIN_CPU, 0,
>                                      0, &gobj);
>         if (r)
> -               goto handle_lockup;
> +               return r;
>
>         bo = gem_to_amdgpu_bo(gobj);
>         bo->prefered_domains = AMDGPU_GEM_DOMAIN_GTT;
> @@ -374,7 +355,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>         /* drop reference from allocate - handle holds it now */
>         drm_gem_object_unreference_unlocked(gobj);
>         if (r)
> -               goto handle_lockup;
> +               return r;
>
>         args->handle = handle;
>         return 0;
> @@ -388,9 +369,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>  release_object:
>         drm_gem_object_unreference_unlocked(gobj);
>
> -handle_lockup:
> -       r = amdgpu_gem_handle_lockup(adev, r);
> -
>         return r;
>  }
>
> @@ -486,7 +464,6 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
>                 r = ret;
>
>         drm_gem_object_unreference_unlocked(gobj);
> -       r = amdgpu_gem_handle_lockup(adev, r);
>         return r;
>  }
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-05-08 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 13:25 [PATCH] drm/amdgpu: remove unsed amdgpu_gem_handle_lockup Christian König
     [not found] ` <1494249902-26592-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-08 18:40   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.