Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a82ec21 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: fix initializing the VM last eviction counter



Close a very small window where something can go wrong.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarEdward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2698f620
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1629,13 +1629,17 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
		goto error_free_page_directory;

	r = amdgpu_vm_clear_bo(adev, vm, vm->page_directory);
	amdgpu_bo_unreserve(vm->page_directory);
	if (r)
		goto error_free_page_directory;
		goto error_unreserve;

	vm->last_eviction_counter = atomic64_read(&adev->num_evictions);
	amdgpu_bo_unreserve(vm->page_directory);

	return 0;

error_unreserve:
	amdgpu_bo_unreserve(vm->page_directory);

error_free_page_directory:
	amdgpu_bo_unref(&vm->page_directory->shadow);
	amdgpu_bo_unref(&vm->page_directory);