drm/amdkfd: Check correct memory types for is_system variable
authorSreekant Somasekharan <sreekant.somasekharan@amd.com>
Fri, 10 May 2024 04:09:32 +0000 (00:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 May 2024 21:40:37 +0000 (17:40 -0400)
To catch GPU mapping of system memory, TTM_PL_TT and AMDGPU_PL_PREEMPT
must be checked.

Fixes: 628e1ace2379 ("drm/amdkfd: mark GFX12 system and peer GPU memory mappings as MTYPE_NC")
Signed-off-by: Sreekant Somasekharan <sreekant.somasekharan@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c

index 34e751b9b700315c3b43fc6d7a4a20feeae82703..00b7aef6bdb0827b91efc1a7444b01d7f04d21f9 100644 (file)
@@ -524,7 +524,8 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
 
        bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
        coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
-       is_system = bo->tbo.resource->mem_type == TTM_PL_SYSTEM;
+       is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
+               (bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
 
        /* WA for HW bug */
        if (is_system || ((bo_adev != adev) && coherent))