amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Add mem sync flag for SDMA IB test
@ 2021-04-20  2:23 Jinzhou Su
  2021-04-20  6:39 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Jinzhou Su @ 2021-04-20  2:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Jinzhou Su, ray.huang

The buffer for SDMA IB test is allocated by sa bo
which may be used by other purpose. Better to flush
the cache before commit the IB.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index b1ad9e52b234..da67f440b102 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -1000,6 +1000,7 @@ static int sdma_v5_2_ring_test_ib(struct amdgpu_ring *ring, long timeout)
 	ib.ptr[7] = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP);
 	ib.length_dw = 8;
 
+	ib.flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
 	r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
 	if (r)
 		goto err1;
-- 
2.27.0

_______________________________________________
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] drm/amdgpu: Add mem sync flag for SDMA IB test
  2021-04-20  2:23 [PATCH] drm/amdgpu: Add mem sync flag for SDMA IB test Jinzhou Su
@ 2021-04-20  6:39 ` Christian König
  2021-04-20  6:55   ` Su, Jinzhou (Joe)
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2021-04-20  6:39 UTC (permalink / raw)
  To: Jinzhou Su, amd-gfx; +Cc: ray.huang

Am 20.04.21 um 04:23 schrieb Jinzhou Su:
> The buffer for SDMA IB test is allocated by sa bo
> which may be used by other purpose. Better to flush
> the cache before commit the IB.

Good point, but shouldn't we do this for a lot of other cases as well?

I think the only place where we should not set the flag is in the CS IOCTL.

Regards,
Christian.

>
> Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index b1ad9e52b234..da67f440b102 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -1000,6 +1000,7 @@ static int sdma_v5_2_ring_test_ib(struct amdgpu_ring *ring, long timeout)
>   	ib.ptr[7] = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP);
>   	ib.length_dw = 8;
>   
> +	ib.flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
>   	r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
>   	if (r)
>   		goto err1;

_______________________________________________
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] drm/amdgpu: Add mem sync flag for SDMA IB test
  2021-04-20  6:39 ` Christian König
@ 2021-04-20  6:55   ` Su, Jinzhou (Joe)
  2021-04-20  7:39     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Su, Jinzhou (Joe) @ 2021-04-20  6:55 UTC (permalink / raw)
  To: Christian König, amd-gfx; +Cc: Huang, Ray

[AMD Official Use Only - Internal Distribution Only]

Hello Christian,

Thanks for your information. We add this due to sdma0 timeout during S3 stress test.
Will update this for other cases in v2.

Regards,
Joe

-----Original Message-----
From: Christian König <ckoenig.leichtzumerken@gmail.com> 
Sent: Tuesday, April 20, 2021 2:39 PM
To: Su, Jinzhou (Joe) <Jinzhou.Su@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Huang, Ray <Ray.Huang@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Add mem sync flag for SDMA IB test

Am 20.04.21 um 04:23 schrieb Jinzhou Su:
> The buffer for SDMA IB test is allocated by sa bo which may be used by 
> other purpose. Better to flush the cache before commit the IB.

Good point, but shouldn't we do this for a lot of other cases as well?

I think the only place where we should not set the flag is in the CS IOCTL.

Regards,
Christian.

>
> Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index b1ad9e52b234..da67f440b102 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -1000,6 +1000,7 @@ static int sdma_v5_2_ring_test_ib(struct amdgpu_ring *ring, long timeout)
>   	ib.ptr[7] = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP);
>   	ib.length_dw = 8;
>   
> +	ib.flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
>   	r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
>   	if (r)
>   		goto err1;
_______________________________________________
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] drm/amdgpu: Add mem sync flag for SDMA IB test
  2021-04-20  6:55   ` Su, Jinzhou (Joe)
@ 2021-04-20  7:39     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2021-04-20  7:39 UTC (permalink / raw)
  To: Su, Jinzhou (Joe), amd-gfx; +Cc: Huang, Ray

I suggest to rather do this in amdgpu_ib_get() instead.

As soon as the size is specified we get some memory from the SA 
allocator and should also set the flag to be on the save side.

Thanks,
Christian.

Am 20.04.21 um 08:55 schrieb Su, Jinzhou (Joe):
> [AMD Official Use Only - Internal Distribution Only]
>
> Hello Christian,
>
> Thanks for your information. We add this due to sdma0 timeout during S3 stress test.
> Will update this for other cases in v2.
>
> Regards,
> Joe
>
> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken@gmail.com>
> Sent: Tuesday, April 20, 2021 2:39 PM
> To: Su, Jinzhou (Joe) <Jinzhou.Su@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Huang, Ray <Ray.Huang@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: Add mem sync flag for SDMA IB test
>
> Am 20.04.21 um 04:23 schrieb Jinzhou Su:
>> The buffer for SDMA IB test is allocated by sa bo which may be used by
>> other purpose. Better to flush the cache before commit the IB.
> Good point, but shouldn't we do this for a lot of other cases as well?
>
> I think the only place where we should not set the flag is in the CS IOCTL.
>
> Regards,
> Christian.
>
>> Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 +
>>    1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> index b1ad9e52b234..da67f440b102 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> @@ -1000,6 +1000,7 @@ static int sdma_v5_2_ring_test_ib(struct amdgpu_ring *ring, long timeout)
>>    	ib.ptr[7] = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP);
>>    	ib.length_dw = 8;
>>    
>> +	ib.flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
>>    	r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
>>    	if (r)
>>    		goto err1;

_______________________________________________
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:[~2021-04-20  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  2:23 [PATCH] drm/amdgpu: Add mem sync flag for SDMA IB test Jinzhou Su
2021-04-20  6:39 ` Christian König
2021-04-20  6:55   ` Su, Jinzhou (Joe)
2021-04-20  7:39     ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).