aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
diff options
context:
space:
mode:
authorTrigger Huang <[email protected]>2017-08-08 10:42:51 +0000
committerAlex Deucher <[email protected]>2017-08-15 18:46:17 +0000
commit41cc07cff24d55661a76efc07d70e80a97af4276 (patch)
tree63f3dc06902deac404851f6ee0bd23a1d28b8651 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
parentdrm/radeon: Fix preferred typo (diff)
downloadkernel-41cc07cff24d55661a76efc07d70e80a97af4276.tar.gz
kernel-41cc07cff24d55661a76efc07d70e80a97af4276.zip
drm/amdgpu: don't finish the ring if not initialized
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 <[email protected]> Reviewed-by: Monk Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 70447567438a..6c5646b48d1a 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);