Commit f5cc09ac authored by Eric Huang's avatar Eric Huang Committed by Alex Deucher

Revert "drm/amdkfd: Add memory sync before TLB flush on unmap"

This reverts commit 3be4dca1.

Reason for revert: it causes regressions on several Asics.
Signed-off-by: default avatarEric Huang <jinhuieric.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 06055d2e
...@@ -1566,29 +1566,13 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, ...@@ -1566,29 +1566,13 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep,
i, args->n_devices); i, args->n_devices);
goto unmap_memory_from_gpu_failed; goto unmap_memory_from_gpu_failed;
} }
args->n_success = i+1;
}
mutex_unlock(&p->mutex);
err = amdgpu_amdkfd_gpuvm_sync_memory(dev->kgd, (struct kgd_mem *) mem, true);
if (err) {
pr_debug("Sync memory failed, wait interrupted by user signal\n");
goto sync_memory_failed;
}
/* Flush TLBs after waiting for the page table updates to complete */
for (i = 0; i < args->n_devices; i++) {
peer = kfd_device_by_id(devices_arr[i]);
if (WARN_ON_ONCE(!peer))
continue;
peer_pdd = kfd_get_process_device_data(peer, p);
if (WARN_ON_ONCE(!peer_pdd))
continue;
kfd_flush_tlb(peer_pdd, TLB_FLUSH_HEAVYWEIGHT); kfd_flush_tlb(peer_pdd, TLB_FLUSH_HEAVYWEIGHT);
args->n_success = i+1;
} }
kfree(devices_arr); kfree(devices_arr);
mutex_unlock(&p->mutex);
return 0; return 0;
bind_process_to_device_failed: bind_process_to_device_failed:
...@@ -1596,7 +1580,6 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, ...@@ -1596,7 +1580,6 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep,
unmap_memory_from_gpu_failed: unmap_memory_from_gpu_failed:
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
copy_from_user_failed: copy_from_user_failed:
sync_memory_failed:
kfree(devices_arr); kfree(devices_arr);
return err; return err;
} }
......
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