All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix double reference dropping
@ 2019-11-06  9:53 ` Pan Bian
  0 siblings, 0 replies; 6+ messages in thread
From: Pan Bian @ 2019-11-06  9:53 UTC (permalink / raw)
  To: Alex Deucher, christian.koenig, David1.Zhou, David Airlie,
	Daniel Vetter, Sam Ravnborg
  Cc: amd-gfx, dri-devel, linux-kernel, Pan Bian

After dropping the reference of object fence in the loop, it should be
set to NULL to protecting dropping its reference again outside the loop.

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 649e68c4479b..3174093f35f3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
 		if (r)
 			goto exit_do_move;
 		dma_fence_put(fence);
+		fence = NULL;
 	}
 	end_jiffies = jiffies;
 	r = jiffies_to_msecs(end_jiffies - start_jiffies);
-- 
2.7.4


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

* [PATCH] drm/amdgpu: fix double reference dropping
@ 2019-11-06  9:53 ` Pan Bian
  0 siblings, 0 replies; 6+ messages in thread
From: Pan Bian @ 2019-11-06  9:53 UTC (permalink / raw)
  To: Alex Deucher, christian.koenig, David1.Zhou, David Airlie,
	Daniel Vetter, Sam Ravnborg
  Cc: Pan Bian, dri-devel, amd-gfx, linux-kernel

After dropping the reference of object fence in the loop, it should be
set to NULL to protecting dropping its reference again outside the loop.

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 649e68c4479b..3174093f35f3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
 		if (r)
 			goto exit_do_move;
 		dma_fence_put(fence);
+		fence = NULL;
 	}
 	end_jiffies = jiffies;
 	r = jiffies_to_msecs(end_jiffies - start_jiffies);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/amdgpu: fix double reference dropping
@ 2019-11-06  9:53 ` Pan Bian
  0 siblings, 0 replies; 6+ messages in thread
From: Pan Bian @ 2019-11-06  9:53 UTC (permalink / raw)
  To: Alex Deucher, christian.koenig, David1.Zhou, David Airlie,
	Daniel Vetter, Sam Ravnborg
  Cc: Pan Bian, dri-devel, amd-gfx, linux-kernel

After dropping the reference of object fence in the loop, it should be
set to NULL to protecting dropping its reference again outside the loop.

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 649e68c4479b..3174093f35f3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
 		if (r)
 			goto exit_do_move;
 		dma_fence_put(fence);
+		fence = NULL;
 	}
 	end_jiffies = jiffies;
 	r = jiffies_to_msecs(end_jiffies - start_jiffies);
-- 
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] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: fix double reference dropping
  2019-11-06  9:53 ` Pan Bian
  (?)
@ 2019-11-06  9:59   ` Koenig, Christian
  -1 siblings, 0 replies; 6+ messages in thread
From: Koenig, Christian @ 2019-11-06  9:59 UTC (permalink / raw)
  To: Pan Bian, Deucher, Alexander, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter, Sam Ravnborg
  Cc: amd-gfx, dri-devel, linux-kernel

Am 06.11.19 um 10:53 schrieb Pan Bian:
> After dropping the reference of object fence in the loop, it should be
> set to NULL to protecting dropping its reference again outside the loop.

NAK, the actual bug is that we shouldn't drop the fence outside the loop 
in the first place.

Just move the dma_fence_put(fence); two lines up and drop initializing 
fence to NULL.

Regards,
Christian.

>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 649e68c4479b..3174093f35f3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
>   		if (r)
>   			goto exit_do_move;
>   		dma_fence_put(fence);
> +		fence = NULL;
>   	}
>   	end_jiffies = jiffies;
>   	r = jiffies_to_msecs(end_jiffies - start_jiffies);


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

* Re: [PATCH] drm/amdgpu: fix double reference dropping
@ 2019-11-06  9:59   ` Koenig, Christian
  0 siblings, 0 replies; 6+ messages in thread
From: Koenig, Christian @ 2019-11-06  9:59 UTC (permalink / raw)
  To: Pan Bian, Deucher, Alexander, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter, Sam Ravnborg
  Cc: dri-devel, amd-gfx, linux-kernel

Am 06.11.19 um 10:53 schrieb Pan Bian:
> After dropping the reference of object fence in the loop, it should be
> set to NULL to protecting dropping its reference again outside the loop.

NAK, the actual bug is that we shouldn't drop the fence outside the loop 
in the first place.

Just move the dma_fence_put(fence); two lines up and drop initializing 
fence to NULL.

Regards,
Christian.

>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 649e68c4479b..3174093f35f3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
>   		if (r)
>   			goto exit_do_move;
>   		dma_fence_put(fence);
> +		fence = NULL;
>   	}
>   	end_jiffies = jiffies;
>   	r = jiffies_to_msecs(end_jiffies - start_jiffies);

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: fix double reference dropping
@ 2019-11-06  9:59   ` Koenig, Christian
  0 siblings, 0 replies; 6+ messages in thread
From: Koenig, Christian @ 2019-11-06  9:59 UTC (permalink / raw)
  To: Pan Bian, Deucher, Alexander, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter, Sam Ravnborg
  Cc: dri-devel, amd-gfx, linux-kernel

Am 06.11.19 um 10:53 schrieb Pan Bian:
> After dropping the reference of object fence in the loop, it should be
> set to NULL to protecting dropping its reference again outside the loop.

NAK, the actual bug is that we shouldn't drop the fence outside the loop 
in the first place.

Just move the dma_fence_put(fence); two lines up and drop initializing 
fence to NULL.

Regards,
Christian.

>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> index 649e68c4479b..3174093f35f3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
> @@ -47,6 +47,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
>   		if (r)
>   			goto exit_do_move;
>   		dma_fence_put(fence);
> +		fence = NULL;
>   	}
>   	end_jiffies = jiffies;
>   	r = jiffies_to_msecs(end_jiffies - start_jiffies);

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

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

end of thread, other threads:[~2019-11-07  7:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06  9:53 [PATCH] drm/amdgpu: fix double reference dropping Pan Bian
2019-11-06  9:53 ` Pan Bian
2019-11-06  9:53 ` Pan Bian
2019-11-06  9:59 ` Koenig, Christian
2019-11-06  9:59   ` Koenig, Christian
2019-11-06  9:59   ` Koenig, Christian

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.