drm/amdgpu/gfx10: fix unbalanced MAP/UNMAP_QUEUES when async_gfx_ring is disabled
authorXiaojie Yuan <xiaojie.yuan@amd.com>
Fri, 19 Apr 2019 10:44:18 +0000 (18:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:28 +0000 (18:59 -0500)
gfx_v10_0_kiq_enable_kgq() is called only when async_gfx_ring is
enabled, so should gfx_v10_0_kiq_disable_kgq().

Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

index 01b3f4ae6aaa092812fbb97a4734a67827e3a34a..f9ad98889c7d07e1f09c7b4f925b0cc8949d16f6 100644 (file)
@@ -3540,7 +3540,7 @@ static int gfx_v10_0_hw_init(void *handle)
 }
 
 #ifndef BRING_UP_DEBUG
-static int gfx10_0_disable_kgq(struct amdgpu_device *adev)
+static int gfx_v10_0_kiq_disable_kgq(struct amdgpu_device *adev)
 {
        struct amdgpu_kiq *kiq = &adev->gfx.kiq;
        struct amdgpu_ring *ring, *kiq_ring = &kiq->ring;
@@ -3589,12 +3589,16 @@ static int gfx10_0_disable_kgq(struct amdgpu_device *adev)
 static int gfx_v10_0_hw_fini(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       int r;
 
        amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
        amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);
 #ifndef BRING_UP_DEBUG
-       if (gfx10_0_disable_kgq(adev))
-               DRM_ERROR("KGQ disable failed\n");
+       if (amdgpu_async_gfx_ring) {
+               r = gfx_v10_0_kiq_disable_kgq(adev);
+               if (r)
+                       DRM_ERROR("KGQ disable failed\n");
+       }
 #endif
        if (amdgpu_gfx_disable_kcq(adev))
                DRM_ERROR("KCQ disable failed\n");