aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch
new file mode 100644
index 00000000..2d50572e
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3798-drm-amdgpu-allocate-PDs-PTs-with-no_gpu_wait-in-a-pa.patch
@@ -0,0 +1,88 @@
+From c70e9556a9c404989fd017291faefa9cadd30cd1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Wed, 17 Jul 2019 14:58:02 +0200
+Subject: [PATCH 3798/4256] drm/amdgpu: allocate PDs/PTs with no_gpu_wait in a
+ page fault
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While handling a page fault we can't wait for other ongoing GPU
+operations or we can potentially run into deadlocks.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++++---
+ 3 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+index 83df25888e02..c82d35faf91c 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+@@ -472,7 +472,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
+ {
+ struct ttm_operation_ctx ctx = {
+ .interruptible = (bp->type != ttm_bo_type_kernel),
+- .no_wait_gpu = false,
++ .no_wait_gpu = bp->no_wait_gpu,
+ .resv = bp->resv,
+ .flags = TTM_OPT_FLAG_ALLOW_RES_EVICT
+ };
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+index aed30cc3f4ca..c3047d2d1833 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+@@ -41,6 +41,7 @@ struct amdgpu_bo_param {
+ u32 preferred_domain;
+ u64 flags;
+ enum ttm_bo_type type;
++ bool no_wait_gpu;
+ struct reservation_object *resv;
+ };
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index b42436fafe4b..9bfa2c295c32 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -794,7 +794,8 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
+ * @bp: resulting BO allocation parameters
+ */
+ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm,
+- int level, struct amdgpu_bo_param *bp)
++ int level, bool direct,
++ struct amdgpu_bo_param *bp)
+ {
+ memset(bp, 0, sizeof(*bp));
+
+@@ -809,6 +810,7 @@ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm,
+ else if (!vm->root.base.bo || vm->root.base.bo->shadow)
+ bp->flags |= AMDGPU_GEM_CREATE_SHADOW;
+ bp->type = ttm_bo_type_kernel;
++ bp->no_wait_gpu = direct;
+ if (vm->root.base.bo)
+ bp->resv = vm->root.base.bo->tbo.resv;
+ }
+@@ -850,7 +852,7 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
+ if (entry->base.bo)
+ return 0;
+
+- amdgpu_vm_bo_param(adev, vm, cursor->level, &bp);
++ amdgpu_vm_bo_param(adev, vm, cursor->level, direct, &bp);
+
+ r = amdgpu_bo_create(adev, &bp, &pt);
+ if (r)
+@@ -2697,7 +2699,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
+ vm->update_funcs = &amdgpu_vm_sdma_funcs;
+ vm->last_update = NULL;
+
+- amdgpu_vm_bo_param(adev, vm, adev->vm_manager.root_level, &bp);
++ amdgpu_vm_bo_param(adev, vm, adev->vm_manager.root_level, false, &bp);
+ if (vm_context == AMDGPU_VM_CONTEXT_COMPUTE)
+ bp.flags &= ~AMDGPU_GEM_CREATE_SHADOW;
+ r = amdgpu_bo_create(adev, &bp, &root);
+--
+2.17.1
+