RE: [PATCH] drm/amdgpu: fix ring test failure issue during s3 in vce 3.0 (V2)

2019-06-04 Thread S, Shirish
Thanks Christian.
Have sent the patch for uvd & vcn.
(https://patchwork.freedesktop.org/patch/308575/)


Regards,
Shirish S

-Original Message-
From: Christian König  
Sent: Tuesday, June 4, 2019 4:38 PM
To: S, Shirish ; Deucher, Alexander 
; Koenig, Christian ; 
jerry.zh...@amd.com; Deng, Emily ; Liu, Leo 

Cc: amd-gfx@lists.freedesktop.org; Li, Ching-shih (Louis) 

Subject: Re: [PATCH] drm/amdgpu: fix ring test failure issue during s3 in vce 
3.0 (V2)

Am 04.06.19 um 10:36 schrieb S, Shirish:
> From: Louis Li 
>
> [What]
> vce ring test fails consistently during resume in s3 cycle, due to 
> mismatch read & write pointers.
> On debug/analysis its found that rptr to be compared is not being 
> correctly updated/read, which leads to this failure.
> Below is the failure signature:
>   [drm:amdgpu_vce_ring_test_ring] *ERROR* amdgpu: ring 12 test failed
>   [drm:amdgpu_device_ip_resume_phase2] *ERROR* resume of IP block 
>  failed -110
>   [drm:amdgpu_device_resume] *ERROR* amdgpu_device_ip_resume failed 
> (-110).
>
> [How]
> fetch rptr appropriately, meaning move its read location further down 
> in the code flow.
> With this patch applied the s3 failure is no more seen for >5k s3 
> cycles, which otherwise is pretty consistent.
>
> V2: remove reduntant fetch of rptr
>
> Signed-off-by: Louis Li 

Reviewed-by: Christian König 
CC: stable...

Who does the same patch for UVD and VCN? Exactly the same thing is wrong there 
as well.

Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index c021b11..f7189e2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -1072,7 +1072,7 @@ void amdgpu_vce_ring_emit_fence(struct amdgpu_ring 
> *ring, u64 addr, u64 seq,
>   int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
>   {
>   struct amdgpu_device *adev = ring->adev;
> - uint32_t rptr = amdgpu_ring_get_rptr(ring);
> + uint32_t rptr;
>   unsigned i;
>   int r, timeout = adev->usec_timeout;
>   
> @@ -1084,6 +1084,8 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
>   if (r)
>   return r;
>   
> + rptr = amdgpu_ring_get_rptr(ring);
> +
>   amdgpu_ring_write(ring, VCE_CMD_END);
>   amdgpu_ring_commit(ring);
>   

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

Re: [PATCH] drm/amdgpu: fix ring test failure issue during s3 in vce 3.0 (V2)

2019-06-04 Thread Christian König

Am 04.06.19 um 10:36 schrieb S, Shirish:

From: Louis Li 

[What]
vce ring test fails consistently during resume in s3 cycle, due to
mismatch read & write pointers.
On debug/analysis its found that rptr to be compared is not being
correctly updated/read, which leads to this failure.
Below is the failure signature:
[drm:amdgpu_vce_ring_test_ring] *ERROR* amdgpu: ring 12 test failed
[drm:amdgpu_device_ip_resume_phase2] *ERROR* resume of IP block 
 failed -110
[drm:amdgpu_device_resume] *ERROR* amdgpu_device_ip_resume failed 
(-110).

[How]
fetch rptr appropriately, meaning move its read location further down
in the code flow.
With this patch applied the s3 failure is no more seen for >5k s3 cycles,
which otherwise is pretty consistent.

V2: remove reduntant fetch of rptr

Signed-off-by: Louis Li 


Reviewed-by: Christian König 
CC: stable...

Who does the same patch for UVD and VCN? Exactly the same thing is wrong 
there as well.


Christian.


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index c021b11..f7189e2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -1072,7 +1072,7 @@ void amdgpu_vce_ring_emit_fence(struct amdgpu_ring *ring, 
u64 addr, u64 seq,
  int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
  {
struct amdgpu_device *adev = ring->adev;
-   uint32_t rptr = amdgpu_ring_get_rptr(ring);
+   uint32_t rptr;
unsigned i;
int r, timeout = adev->usec_timeout;
  
@@ -1084,6 +1084,8 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)

if (r)
return r;
  
+	rptr = amdgpu_ring_get_rptr(ring);

+
amdgpu_ring_write(ring, VCE_CMD_END);
amdgpu_ring_commit(ring);
  


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