From: Christian König Date: Tue, 25 Aug 2015 13:05:20 +0000 (+0200) Subject: drm/amdgpu: fix postclose order X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=02537d63623ce5281c20d76f1b61797a7836acf4;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: fix postclose order The context needs to finish before everything else. Signed-off-by: Christian König Acked-by: Alex Deucher Reviewed-by: Jammy Zhou Reviewed-by: Chunming Zhou --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 87da6b1848fd..22367939ebf1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -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; }