Re: [PATCH] drm/amdgpu: Not to finish an uninitialized ring

2017-08-08 Thread Christian König

Am 08.08.2017 um 13:13 schrieb Liu, Monk:

+   /* Not to finish a ring which is not initialized */

Just write "don't finish the ring if not initialized"


With that comment addressed,
Reviewed-by: Monk Liu 


Additional to that the commit message is to long. Please break it after 
80 chars.


With that fixed the patch is Reviewed-by: Christian König 





-Original Message-
From: Trigger Huang [mailto:trigger.hu...@amd.com]
Sent: Tuesday, August 8, 2017 6:56 PM
To: amd-gfx@lists.freedesktop.org
Cc: Liu, Monk ; Yu, Xiangliang ; Huang, 
Trigger 
Subject: [PATCH] drm/amdgpu: Not to finish an uninitialized ring

If a ring is not initialized, it also should not be finished.
For example, in Vega10's SR-IOV environment, UVD's decode ring is not 
initialized, but will be finnished in amdgpu_uvd_sw_fini, because UVD driver 
put all the uvd decode ring's finish operation into amdgpu_uvd_sw_fini 
function, while not uvd_vXXX_0_sw_fini. This will lead to amdgpu module 
unloading failure.

Signed-off-by: Trigger Huang 
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 704475674..6c5646b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -261,6 +261,10 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)  {
ring->ready = false;
  
+	/* Not to finish a ring which is not initialized */

+   if (!(ring->adev) || !(ring->adev->rings[ring->idx]))
+   return;
+
amdgpu_wb_free(ring->adev, ring->rptr_offs);
amdgpu_wb_free(ring->adev, ring->wptr_offs);
  
--

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


RE: [PATCH] drm/amdgpu: Not to finish an uninitialized ring

2017-08-08 Thread Liu, Monk
>+  /* Not to finish a ring which is not initialized */

Just write "don't finish the ring if not initialized"


With that comment addressed,
Reviewed-by: Monk Liu 

-Original Message-
From: Trigger Huang [mailto:trigger.hu...@amd.com] 
Sent: Tuesday, August 8, 2017 6:56 PM
To: amd-gfx@lists.freedesktop.org
Cc: Liu, Monk ; Yu, Xiangliang ; 
Huang, Trigger 
Subject: [PATCH] drm/amdgpu: Not to finish an uninitialized ring

If a ring is not initialized, it also should not be finished.
For example, in Vega10's SR-IOV environment, UVD's decode ring is not 
initialized, but will be finnished in amdgpu_uvd_sw_fini, because UVD driver 
put all the uvd decode ring's finish operation into amdgpu_uvd_sw_fini 
function, while not uvd_vXXX_0_sw_fini. This will lead to amdgpu module 
unloading failure.

Signed-off-by: Trigger Huang 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 704475674..6c5646b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -261,6 +261,10 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)  {
ring->ready = false;
 
+   /* Not to finish a ring which is not initialized */
+   if (!(ring->adev) || !(ring->adev->rings[ring->idx]))
+   return;
+
amdgpu_wb_free(ring->adev, ring->rptr_offs);
amdgpu_wb_free(ring->adev, ring->wptr_offs);
 
--
2.7.4

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