drm/amdgpu: Let KFD sync with VM fences
authorFelix Kuehling <Felix.Kuehling@amd.com>
Mon, 18 Dec 2023 21:17:23 +0000 (16:17 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jan 2024 15:46:13 +0000 (10:46 -0500)
Change the rules for amdgpu_sync_resv to let KFD synchronize with VM
fences on page table reservations. This fixes intermittent memory
corruption after evictions when using amdgpu_vm_handle_moved to update
page tables for VM mappings managed through render nodes.

Signed-off-by: Felix Kuehling <Felix.Kuehling@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_sync.c

index dcd8c066bc1f5024814853a9f9689b3c8eef4132..1b013a44ca99af7a51bee203b7f91c738b3500df 100644 (file)
@@ -191,7 +191,8 @@ static bool amdgpu_sync_test_fence(struct amdgpu_device *adev,
 
        /* Never sync to VM updates either. */
        if (fence_owner == AMDGPU_FENCE_OWNER_VM &&
-           owner != AMDGPU_FENCE_OWNER_UNDEFINED)
+           owner != AMDGPU_FENCE_OWNER_UNDEFINED &&
+           owner != AMDGPU_FENCE_OWNER_KFD)
                return false;
 
        /* Ignore fences depending on the sync mode */