aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch')
-rw-r--r--meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch b/meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch
new file mode 100644
index 00000000..3d52ed29
--- /dev/null
+++ b/meta-amdfalconx86/recipes-kernel/linux/files/0379-drm-amdgpu-Revert-add-spin-lock-to-protect-freed-lis.patch
@@ -0,0 +1,86 @@
+From 60869b7c5d7aaa900e7f965b3e6da3dc512463fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Tue, 8 Mar 2016 17:52:01 +0100
+Subject: [PATCH 0379/1110] drm/amdgpu: Revert "add spin lock to protect freed
+ list in vm (v3)"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Not needed any more because we need to protect the elements on the list anyway.
+
+This reverts commit dae6ecf9e6c9b677e577826c3ac665c6dd9c490b.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 +++-------------
+ 1 file changed, 3 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index a80de65..c6b890c 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -976,22 +976,18 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
+ struct amdgpu_bo_va_mapping *mapping;
+ int r;
+
+- spin_lock(&vm->freed_lock);
+ while (!list_empty(&vm->freed)) {
+ mapping = list_first_entry(&vm->freed,
+ struct amdgpu_bo_va_mapping, list);
+ list_del(&mapping->list);
+- spin_unlock(&vm->freed_lock);
++
+ r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, vm, mapping,
+ 0, NULL);
+ kfree(mapping);
+ if (r)
+ return r;
+
+- spin_lock(&vm->freed_lock);
+ }
+- spin_unlock(&vm->freed_lock);
+-
+ return 0;
+
+ }
+@@ -1257,13 +1253,10 @@ int amdgpu_vm_bo_unmap(struct amdgpu_device *adev,
+ spin_unlock(&vm->it_lock);
+ trace_amdgpu_vm_bo_unmap(bo_va, mapping);
+
+- if (valid) {
+- spin_lock(&vm->freed_lock);
++ if (valid)
+ list_add(&mapping->list, &vm->freed);
+- spin_unlock(&vm->freed_lock);
+- } else {
++ else
+ kfree(mapping);
+- }
+
+ return 0;
+ }
+@@ -1296,9 +1289,7 @@ void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,
+ interval_tree_remove(&mapping->it, &vm->va);
+ spin_unlock(&vm->it_lock);
+ trace_amdgpu_vm_bo_unmap(bo_va, mapping);
+- spin_lock(&vm->freed_lock);
+ list_add(&mapping->list, &vm->freed);
+- spin_unlock(&vm->freed_lock);
+ }
+ list_for_each_entry_safe(mapping, next, &bo_va->invalids, list) {
+ list_del(&mapping->list);
+@@ -1364,7 +1355,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
+ INIT_LIST_HEAD(&vm->cleared);
+ INIT_LIST_HEAD(&vm->freed);
+ spin_lock_init(&vm->it_lock);
+- spin_lock_init(&vm->freed_lock);
+ pd_size = amdgpu_vm_directory_size(adev);
+ pd_entries = amdgpu_vm_num_pdes(adev);
+
+--
+2.7.4
+