diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3292-drm-amdgpu-fix-another-potential-cause-of-VM-faults.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3292-drm-amdgpu-fix-another-potential-cause-of-VM-faults.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3292-drm-amdgpu-fix-another-potential-cause-of-VM-faults.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3292-drm-amdgpu-fix-another-potential-cause-of-VM-faults.patch new file mode 100644 index 00000000..620a2ba2 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3292-drm-amdgpu-fix-another-potential-cause-of-VM-faults.patch @@ -0,0 +1,80 @@ +From 180989954bbfe805018af7138314f70c55356215 Mon Sep 17 00:00:00 2001 +From: Christian Koenig <christian.koenig@amd.com> +Date: Wed, 24 Jan 2018 14:57:02 +0100 +Subject: [PATCH 3292/4131] drm/amdgpu: fix another potential cause of VM + faults +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The root PD can be evicted directly after allocating it, just validate +it on first use. + +Signed-off-by: Christian König <christian.koenig@amd.com> +Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 32 ++++++++++++-------------------- + 1 file changed, 12 insertions(+), 20 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index 59abde3..de11ed9 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -2274,12 +2274,12 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, + { + const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE, + AMDGPU_VM_PTE_COUNT(adev) * 8); ++ uint64_t init_pde_value = 0, flags; + unsigned ring_instance; + struct amdgpu_ring *ring; + struct drm_sched_rq *rq; ++ unsigned long size; + int r, i; +- u64 flags; +- uint64_t init_pde_value = 0; + + vm->va = RB_ROOT_CACHED; + for (i = 0; i < AMDGPU_MAX_VMHUBS; i++) +@@ -2330,29 +2330,21 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, + flags |= (AMDGPU_GEM_CREATE_NO_CPU_ACCESS | + AMDGPU_GEM_CREATE_SHADOW); + +- r = amdgpu_bo_create(adev, +- amdgpu_vm_bo_size(adev, adev->vm_manager.root_level), +- align, true, +- AMDGPU_GEM_DOMAIN_VRAM, +- flags, +- NULL, NULL, init_pde_value, &vm->root.base.bo); ++ size = amdgpu_vm_bo_size(adev, adev->vm_manager.root_level); ++ r = amdgpu_bo_create(adev, size, align, true, AMDGPU_GEM_DOMAIN_VRAM, ++ flags, NULL, NULL, init_pde_value, ++ &vm->root.base.bo); + if (r) + goto error_free_sched_entity; + ++ r = amdgpu_bo_reserve(vm->root.base.bo, true); ++ if (r) ++ goto error_free_root; ++ + vm->root.base.vm = vm; + list_add_tail(&vm->root.base.bo_list, &vm->root.base.bo->va); +- INIT_LIST_HEAD(&vm->root.base.vm_status); +- +- if (vm->use_cpu_for_update) { +- r = amdgpu_bo_reserve(vm->root.base.bo, false); +- if (r) +- goto error_free_root; +- +- r = amdgpu_bo_kmap(vm->root.base.bo, NULL); +- amdgpu_bo_unreserve(vm->root.base.bo); +- if (r) +- goto error_free_root; +- } ++ list_add_tail(&vm->root.base.vm_status, &vm->evicted); ++ amdgpu_bo_unreserve(vm->root.base.bo); + + if (pasid) { + unsigned long flags; +-- +2.7.4 + |