Commit 04fe3fd1 authored by Philip Yang's avatar Philip Yang Committed by Alex Deucher

drm/amdkfd: handle errors returned by svm_migrate_copy_to_vram/ram

If migration copy failed because process is killed, or out of VRAM or
system memory, pass error code back to caller to handle error
gracefully.
Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ef0d7d20
......@@ -460,7 +460,7 @@ svm_migrate_vma_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
}
if (migrate.cpages) {
svm_migrate_copy_to_vram(adev, prange, &migrate, &mfence,
r = svm_migrate_copy_to_vram(adev, prange, &migrate, &mfence,
scratch);
migrate_vma_pages(&migrate);
svm_migrate_copy_done(adev, mfence);
......@@ -663,7 +663,7 @@ svm_migrate_vma_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
pr_debug("cpages %ld\n", migrate.cpages);
if (migrate.cpages) {
svm_migrate_copy_to_ram(adev, prange, &migrate, &mfence,
r = svm_migrate_copy_to_ram(adev, prange, &migrate, &mfence,
scratch);
migrate_vma_pages(&migrate);
svm_migrate_copy_done(adev, mfence);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment