drm/amdgpu: Correct the condition of warning while bo release
authorxinhui pan <xinhui.pan@amd.com>
Mon, 9 Mar 2020 14:28:01 +0000 (22:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Mar 2020 19:54:42 +0000 (15:54 -0400)
Only kernel bo has kfd eviction fence.
This warning is to give a notice that kfd only remove eviction fence on
individual bos.

Tested-by: Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index e4a8c424d290f8c7e785808e87a99fb844d17d24..5ba4f0309910da5726a1fbcfa9782e12d20b1e48 100644 (file)
@@ -1308,7 +1308,8 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
                amdgpu_amdkfd_unreserve_memory_limit(abo);
 
        /* We only remove the fence if the resv has individualized. */
-       WARN_ON_ONCE(bo->base.resv != &bo->base._resv);
+       WARN_ON_ONCE(bo->type == ttm_bo_type_kernel
+                       && bo->base.resv != &bo->base._resv);
        if (bo->base.resv == &bo->base._resv)
                amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);