aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch
new file mode 100644
index 00000000..d8115919
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/1734-amd-amdkfd-follow-up-change-for-signal-handling.patch
@@ -0,0 +1,62 @@
+From 2da3a382972793451d3b4486c4cee7e35960c116 Mon Sep 17 00:00:00 2001
+From: Lan Xiao <Lan.Xiao@amd.com>
+Date: Thu, 6 Jul 2017 15:57:27 -0400
+Subject: [PATCH 1734/4131] amd/amdkfd: follow-up change for signal handling
+
+1. Unreserve BOs even if the wait fails (e.g. interrupted system call).
+When the system call is restarted, it will reserve the BO again
+
+2. Create mem->sync object when importing a dmabuf
+
+Change-Id: Iceb68ccec800a6fac062f8b41831f4868235f49e
+Signed-off-by: Lan Xiao <Lan.Xiao@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index 475e7fb..01414bc 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -874,11 +874,8 @@ static int unreserve_bo_and_vms(struct bo_vm_reservation_context *ctx,
+ {
+ int ret = 0;
+
+- if (wait) {
++ if (wait)
+ ret = amdgpu_sync_wait(ctx->sync, intr);
+- if (ret)
+- return ret;
+- }
+
+ if (ctx->reserved)
+ ttm_eu_backoff_reservation(&ctx->ticket, &ctx->list);
+@@ -1228,7 +1225,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
+ entry, bo_size);
+ }
+
+- ret = unreserve_bo_and_vms(&ctx, false, true);
++ ret = unreserve_bo_and_vms(&ctx, false, false);
+
+ /* Free the sync object */
+ amdgpu_sync_free(&mem->sync);
+@@ -1357,7 +1354,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
+ amdgpu_bo_fence(bo,
+ &kfd_vm->process_info->eviction_fence->base,
+ true);
+- ret = unreserve_bo_and_vms(&ctx, false, true);
++ ret = unreserve_bo_and_vms(&ctx, false, false);
+
+ mutex_unlock(&mem->process_info->lock);
+ mutex_unlock(&mem->lock);
+@@ -1866,6 +1863,7 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,
+ (*mem)->mapped_to_gpu_memory = 0;
+ (*mem)->process_info = kfd_vm->process_info;
+ add_kgd_mem_to_kfd_bo_list(*mem, kfd_vm->process_info, false);
++ amdgpu_sync_create(&(*mem)->sync);
+
+ return 0;
+ }
+--
+2.7.4
+