drm/amdgpu: Reverse the sequence of ctx_mgr_fini
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 22 Oct 2018 09:37:00 +0000 (17:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Nov 2018 19:21:10 +0000 (14:21 -0500)
and vm_fini in amdgpu_driver_postclose_kms

csa buffer will be created per ctx, when ctx fini,
the csa buffer and va will be released. so need to
do ctx_mgr fin before vm fini.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index 81732a84c2ab090af4e2f834e2223c0eeabe2bcc..09fa919d250086de7715b01a78c6ece64e21fa2c 100644 (file)
@@ -1048,8 +1048,8 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
        pasid = fpriv->vm.pasid;
        pd = amdgpu_bo_ref(fpriv->vm.root.base.bo);
 
-       amdgpu_vm_fini(adev, &fpriv->vm);
        amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
+       amdgpu_vm_fini(adev, &fpriv->vm);
 
        if (pasid)
                amdgpu_pasid_free_delayed(pd->tbo.resv, pasid);