All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up
@ 2017-04-24 19:34 Alex Xie
       [not found] ` <1493062478-12753-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Xie @ 2017-04-24 19:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Xie

Change-Id: Ib69f035eeb213a1aec5025e0a9f4515065706118
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 3453052..76be2d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -117,6 +117,11 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
 	}
 
 out_cleanup:
+	/* Check error value now. The value can be overwritten when clean up.*/
+	if (r) {
+		DRM_ERROR("Error while benchmarking BO move.\n");
+	}
+
 	if (sobj) {
 		r = amdgpu_bo_reserve(sobj, false);
 		if (likely(r == 0)) {
@@ -133,10 +138,6 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
 		}
 		amdgpu_bo_unref(&dobj);
 	}
-
-	if (r) {
-		DRM_ERROR("Error while benchmarking BO move.\n");
-	}
 }
 
 void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
-- 
1.9.1

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

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

* [PATCH 2/2] drm/amdgpu: Fix use of interruptible waiting 1. The signal interrupt can affect the expected behaviour. 2. There is no good mechanism to handle the corresponding error. When signal interrupt happens, unpin is not called. As a result, inside AMDGPU, the statistic of pin size will be wrong.
       [not found] ` <1493062478-12753-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
@ 2017-04-24 19:34   ` Alex Xie
       [not found]     ` <1493062478-12753-2-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
  2017-04-25  7:59   ` [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up Christian König
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Xie @ 2017-04-24 19:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Xie

Change-Id: I6889a4d9dd2703bcf5d448d18f6af51c496a93c9
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 76be2d2..75bd76f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -123,7 +123,7 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
 	}
 
 	if (sobj) {
-		r = amdgpu_bo_reserve(sobj, false);
+		r = amdgpu_bo_reserve(sobj, true);
 		if (likely(r == 0)) {
 			amdgpu_bo_unpin(sobj);
 			amdgpu_bo_unreserve(sobj);
@@ -131,7 +131,7 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
 		amdgpu_bo_unref(&sobj);
 	}
 	if (dobj) {
-		r = amdgpu_bo_reserve(dobj, false);
+		r = amdgpu_bo_reserve(dobj, true);
 		if (likely(r == 0)) {
 			amdgpu_bo_unpin(dobj);
 			amdgpu_bo_unreserve(dobj);
-- 
1.9.1

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

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

* Re: [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up
       [not found] ` <1493062478-12753-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
  2017-04-24 19:34   ` [PATCH 2/2] drm/amdgpu: Fix use of interruptible waiting 1. The signal interrupt can affect the expected behaviour. 2. There is no good mechanism to handle the corresponding error. When signal interrupt happens, unpin is not called. As a result, inside AMDGPU, the statistic of pin size will be wrong Alex Xie
@ 2017-04-25  7:59   ` Christian König
  1 sibling, 0 replies; 4+ messages in thread
From: Christian König @ 2017-04-25  7:59 UTC (permalink / raw)
  To: Alex Xie, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 24.04.2017 um 21:34 schrieb Alex Xie:
> Change-Id: Ib69f035eeb213a1aec5025e0a9f4515065706118
> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 3453052..76be2d2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -117,6 +117,11 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
>   	}
>   
>   out_cleanup:
> +	/* Check error value now. The value can be overwritten when clean up.*/
> +	if (r) {
> +		DRM_ERROR("Error while benchmarking BO move.\n");
> +	}
> +
>   	if (sobj) {
>   		r = amdgpu_bo_reserve(sobj, false);
>   		if (likely(r == 0)) {
> @@ -133,10 +138,6 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
>   		}
>   		amdgpu_bo_unref(&dobj);
>   	}
> -
> -	if (r) {
> -		DRM_ERROR("Error while benchmarking BO move.\n");
> -	}
>   }
>   
>   void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)


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

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

* Re: [PATCH 2/2] drm/amdgpu: Fix use of interruptible waiting 1. The signal interrupt can affect the expected behaviour. 2. There is no good mechanism to handle the corresponding error. When signal interrupt happens, unpin is not called. As a result, inside AMDGPU, the statistic of pin size will be wrong.
       [not found]     ` <1493062478-12753-2-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
@ 2017-04-25  8:02       ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2017-04-25  8:02 UTC (permalink / raw)
  To: Alex Xie, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

You somehow messed up the commit message. Everything got mangled into 
the subject line while sending the mails.

Apart from that the change looks good to me and with the commit message 
fixed is Reviewed-by: Christian König <christian.koenig@amd.com>

Regards,
Christian.

Am 24.04.2017 um 21:34 schrieb Alex Xie:
> Change-Id: I6889a4d9dd2703bcf5d448d18f6af51c496a93c9
> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 76be2d2..75bd76f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -123,7 +123,7 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
>   	}
>   
>   	if (sobj) {
> -		r = amdgpu_bo_reserve(sobj, false);
> +		r = amdgpu_bo_reserve(sobj, true);
>   		if (likely(r == 0)) {
>   			amdgpu_bo_unpin(sobj);
>   			amdgpu_bo_unreserve(sobj);
> @@ -131,7 +131,7 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
>   		amdgpu_bo_unref(&sobj);
>   	}
>   	if (dobj) {
> -		r = amdgpu_bo_reserve(dobj, false);
> +		r = amdgpu_bo_reserve(dobj, true);
>   		if (likely(r == 0)) {
>   			amdgpu_bo_unpin(dobj);
>   			amdgpu_bo_unreserve(dobj);


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

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

end of thread, other threads:[~2017-04-25  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 19:34 [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up Alex Xie
     [not found] ` <1493062478-12753-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-04-24 19:34   ` [PATCH 2/2] drm/amdgpu: Fix use of interruptible waiting 1. The signal interrupt can affect the expected behaviour. 2. There is no good mechanism to handle the corresponding error. When signal interrupt happens, unpin is not called. As a result, inside AMDGPU, the statistic of pin size will be wrong Alex Xie
     [not found]     ` <1493062478-12753-2-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-04-25  8:02       ` Christian König
2017-04-25  7:59   ` [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up Christian König

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.