mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-05 05:47:04 +07:00
drm/amdgpu: fix initializing the VM last eviction counter
Close a very small window where something can go wrong. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2698f6206f
commit
2a82ec21b9
@ -1629,13 +1629,17 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
|
|||||||
goto error_free_page_directory;
|
goto error_free_page_directory;
|
||||||
|
|
||||||
r = amdgpu_vm_clear_bo(adev, vm, vm->page_directory);
|
r = amdgpu_vm_clear_bo(adev, vm, vm->page_directory);
|
||||||
amdgpu_bo_unreserve(vm->page_directory);
|
|
||||||
if (r)
|
if (r)
|
||||||
goto error_free_page_directory;
|
goto error_unreserve;
|
||||||
|
|
||||||
vm->last_eviction_counter = atomic64_read(&adev->num_evictions);
|
vm->last_eviction_counter = atomic64_read(&adev->num_evictions);
|
||||||
|
amdgpu_bo_unreserve(vm->page_directory);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error_unreserve:
|
||||||
|
amdgpu_bo_unreserve(vm->page_directory);
|
||||||
|
|
||||||
error_free_page_directory:
|
error_free_page_directory:
|
||||||
amdgpu_bo_unref(&vm->page_directory->shadow);
|
amdgpu_bo_unref(&vm->page_directory->shadow);
|
||||||
amdgpu_bo_unref(&vm->page_directory);
|
amdgpu_bo_unref(&vm->page_directory);
|
||||||
|
Loading…
Reference in New Issue
Block a user