diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0826-drm-amdgpu-Remove-explicit-wait-after-VM-validate.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.19.8/0826-drm-amdgpu-Remove-explicit-wait-after-VM-validate.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0826-drm-amdgpu-Remove-explicit-wait-after-VM-validate.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0826-drm-amdgpu-Remove-explicit-wait-after-VM-validate.patch new file mode 100644 index 00000000..f972d164 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0826-drm-amdgpu-Remove-explicit-wait-after-VM-validate.patch @@ -0,0 +1,76 @@ +From cc387a8d5d2196917684b80ca3d6eb02ddabd9df Mon Sep 17 00:00:00 2001 +From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +Date: Fri, 26 Jan 2018 15:36:06 -0500 +Subject: [PATCH 0826/2940] drm/amdgpu: Remove explicit wait after VM validate + +PD or PT might have to be moved during validation and this move has to be +completed before updating it. If page table updates are done using SDMA +then this serializing is done by SDMA command submission. + +And if PD/PT updates are done by CPU, then explicit waiting for PD/PT +updates are done in amdgpu VM amdgpu_vm_wait_pd function. + +Sync to PD BO moving fence to handle corner case where none of the PTs +are updated but PD is evicted. + +Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Acked-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 31 ++++++++++++++----- + 1 file changed, 24 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +index 3db2ff70934f..6871ffe39a1d 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +@@ -904,6 +904,26 @@ static int process_validate_vms(struct amdkfd_process_info *process_info) + return 0; + } + ++static int process_sync_pds_resv(struct amdkfd_process_info *process_info, ++ struct amdgpu_sync *sync) ++{ ++ struct amdgpu_vm *peer_vm; ++ int ret; ++ ++ list_for_each_entry(peer_vm, &process_info->vm_list_head, ++ vm_list_node) { ++ struct amdgpu_bo *pd = peer_vm->root.base.bo; ++ ++ ret = amdgpu_sync_resv(amdgpu_ttm_adev(pd->tbo.bdev), ++ sync, pd->tbo.resv, ++ AMDGPU_FENCE_OWNER_UNDEFINED, false); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ + static int process_update_pds(struct amdkfd_process_info *process_info, + struct amdgpu_sync *sync) + { +@@ -2024,13 +2044,10 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef) + if (ret) + goto validate_map_fail; + +- /* Wait for PD/PTs validate to finish */ +- /* FIXME: I think this isn't needed */ +- list_for_each_entry(peer_vm, &process_info->vm_list_head, +- vm_list_node) { +- struct amdgpu_bo *bo = peer_vm->root.base.bo; +- +- ttm_bo_wait(&bo->tbo, false, false); ++ ret = process_sync_pds_resv(process_info, &sync_obj); ++ if (ret) { ++ pr_debug("Memory eviction: Failed to sync to PD BO moving fence. Try again\n"); ++ goto validate_map_fail; + } + + /* Validate BOs and map them to GPUVM (update VM page tables). */ +-- +2.17.1 + |