drm/amdgpu: Fix some unload driver issues
authorEmily Deng <Emily.Deng@amd.com>
Fri, 5 Mar 2021 09:03:52 +0000 (17:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Mar 2021 20:12:41 +0000 (15:12 -0500)
If have memory leak, maybe it will have issue in
ttm_bo_force_list_clean-> ttm_mem_evict_first.

Set adev->gart.ptr to null to avoid to call
amdgpu_gmc_set_pte_pde to cause ptr issue pointer when
calling amdgpu_gart_unbind in amdgpu_bo_fini which is after gart_fini.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c

index 23823a5..f1ede4b 100644 (file)
@@ -202,6 +202,7 @@ void amdgpu_gart_table_vram_free(struct amdgpu_device *adev)
                return;
        }
        amdgpu_bo_unref(&adev->gart.bo);
+       adev->gart.ptr = NULL;
 }
 
 /*