Skip to content

Commit 7f11a83

Browse files
hkasivisalexdeucher
authored andcommitted
drm/amdkfd: Enforce queue BO's adev
Queue buffer, though it is in system memory, has to be created using the correct amdgpu device. Enforce this as the BO needs to mapped to the GART for MES Hardware scheduler to access it. Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 4fdd07c commit 7f11a83

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ static int kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
371371
err = -EINVAL;
372372
goto err_wptr_map_gart;
373373
}
374+
if (dev->adev != amdgpu_ttm_adev(wptr_bo->tbo.bdev)) {
375+
pr_err("Queue memory allocated to wrong device\n");
376+
err = -EINVAL;
377+
goto err_wptr_map_gart;
378+
}
374379

375380
err = amdgpu_amdkfd_map_gtt_bo_to_gart(wptr_bo);
376381
if (err) {

0 commit comments

Comments
 (0)