aboutsummarylogtreecommitdiffstats
path: root/patch_amd_amdgpu_amdgpu_mn_c.patch
blob: 8d39538a18d35a3c6f7430a98287bb1de4991ca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- ./amd/amdgpu/amdgpu_mn.c.orig	2019-07-23 18:15:10.135709298 +0000
+++ ./amd/amdgpu/amdgpu_mn.c	2019-07-23 18:18:08.299036001 +0000
@@ -280,14 +280,22 @@
 	/* TODO we should be able to split locking for interval tree and
 	 * amdgpu_mn_invalidate_node
 	 */
+#if DRM_VERSION_CODE >= DRM_VERSION(5, 2, 0)
+	if (amdgpu_mn_read_lock(amn, mmu_notifier_range_blockable(range)))
+#else
 	if (amdgpu_mn_read_lock(amn, range->blockable))
+#endif
 		return -EAGAIN;
 
 	it = interval_tree_iter_first(&amn->objects, range->start, end);
 	while (it) {
 		struct amdgpu_mn_node *node;
 
+#if DRM_VERSION_CODE >= DRM_VERSION(5, 2, 0)
+		if (!mmu_notifier_range_blockable(range)) {
+#else
 		if (!range->blockable) {
+#endif
 			amdgpu_mn_read_unlock(amn);
 			return -EAGAIN;
 		}
@@ -323,7 +331,11 @@
 	/* notification is exclusive, but interval is inclusive */
 	end = range->end - 1;
 
+#if DRM_VERSION_CODE >= DRM_VERSION(5, 2, 0)
+	if (amdgpu_mn_read_lock(amn, mmu_notifier_range_blockable(range)))
+#else
 	if (amdgpu_mn_read_lock(amn, range->blockable))
+#endif
 		return -EAGAIN;
 
 	it = interval_tree_iter_first(&amn->objects, range->start, end);
@@ -331,7 +343,11 @@
 		struct amdgpu_mn_node *node;
 		struct amdgpu_bo *bo;
 
+#if DRM_VERSION_CODE >= DRM_VERSION(5, 2, 0)
+		if (!mmu_notifier_range_blockable(range)) {
+#else
 		if (!range->blockable) {
+#endif
 			amdgpu_mn_read_unlock(amn);
 			return -EAGAIN;
 		}