drm/amdgpu: fix postclose order
authorChristian König <christian.koenig@amd.com>
Tue, 25 Aug 2015 13:05:20 +0000 (15:05 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Aug 2015 21:51:37 +0000 (17:51 -0400)
The context needs to finish before everything else.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index 87da6b1..2236793 100644 (file)
@@ -560,6 +560,8 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
        if (!fpriv)
                return;
 
+       amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
+
        amdgpu_vm_fini(adev, &fpriv->vm);
 
        idr_for_each_entry(&fpriv->bo_list_handles, list, handle)
@@ -568,8 +570,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
        idr_destroy(&fpriv->bo_list_handles);
        mutex_destroy(&fpriv->bo_list_lock);
 
-       amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
-
        kfree(fpriv);
        file_priv->driver_priv = NULL;
 }