Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdkfd: check if vm ready in svm map and unmap to gpu

Don't map or unmap svm range to gpu if vm is not ready for updates.

Why: DRM entity may already be killed when the svm worker try to
update gpu vm.

Signed-off-by: YuanShang <YuanShang.Mao@amd.com>
Reviewed-by: Philip Yang <philip.yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 55f8e366c326980174a4f2b9501b524d8eb25135)

authored by

YuanShang and committed by
Alex Deucher
d0f5711f 045e0ff2

+11
+11
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
··· 1366 1366 1367 1367 pr_debug("CPU[0x%llx 0x%llx] -> GPU[0x%llx 0x%llx]\n", start, last, 1368 1368 gpu_start, gpu_end); 1369 + 1370 + if (!amdgpu_vm_ready(vm)) { 1371 + pr_debug("VM not ready, canceling unmap\n"); 1372 + return -EINVAL; 1373 + } 1374 + 1369 1375 return amdgpu_vm_update_range(adev, vm, false, true, true, false, NULL, gpu_start, 1370 1376 gpu_end, init_pte_value, 0, 0, NULL, NULL, 1371 1377 fence); ··· 1448 1442 1449 1443 pr_debug("svms 0x%p [0x%lx 0x%lx] readonly %d\n", prange->svms, 1450 1444 last_start, last_start + npages - 1, readonly); 1445 + 1446 + if (!amdgpu_vm_ready(vm)) { 1447 + pr_debug("VM not ready, canceling map\n"); 1448 + return -EINVAL; 1449 + } 1451 1450 1452 1451 for (i = offset; i < offset + npages; i++) { 1453 1452 uint64_t gpu_start;