drm/amdkfd: Map wptr BO to GART unconditionally
authorLang Yu <lang.yu@amd.com>
Fri, 23 May 2025 02:04:54 +0000 (10:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 29 May 2025 14:58:44 +0000 (10:58 -0400)
commit30837a49bd0aba0f311d4056cd48753955f60d40
treea2e3ba6f3ccdefa1716c4d47ce300dbecdbe13ed
parent684530526f07d488986bc34244034e54e00759a4
drm/amdkfd: Map wptr BO to GART unconditionally

For simulation C models that don't run CP FW where adev->mes.sched_version
is not populated correctly. This causes NULL dereference in
amdgpu_amdkfd_free_gtt_mem(dev->adev, (void **)&pqn->q->wptr_bo_gart)
and warning on unpinned BO in amdgpu_bo_gpu_offset(q->properties.wptr_bo).

Compared with adding version check here and there,
always map wptr BO to GART simplifies things.

v2: Add NULL check in amdgpu_amdkfd_free_gtt_mem.(Philip)

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c