-
Notifications
You must be signed in to change notification settings - Fork 1
/
nvidia-390xx-kmod-0089-kernel-6.10-removed-follow_pfn-function.patch
65 lines (59 loc) · 2.12 KB
/
nvidia-390xx-kmod-0089-kernel-6.10-removed-follow_pfn-function.patch
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From de3bf7828321bf3a36a61d53ab658511a7e68fcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <[email protected]>
Date: Mon, 19 Aug 2024 13:55:15 +0200
Subject: [PATCH] Linux 6.10: follow_pfn function removed, then undef
NV_FOLLOW_PFN_PRESENT
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Nicolas Viéville <[email protected]>
---
kernel/conftest.sh | 18 +++++++++++++-----
kernel/nvidia/os-mlock.c | 4 +++-
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index e20ed5f..72cf3ec 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -660,13 +660,21 @@ compile_test() {
# Determine if the follow_pfn() function is
# present.
#
- CODE="
+ # follow_pfn() was added by commit 3b6748e2dd69
+ # ("mm: introduce follow_pfn()") in v2.6.31-rc1, and removed
+ # by commit 233eb0bf3b94 ("mm: remove follow_pfn")
+ # from linux-next 233eb0bf3b94.
+ #
+ # Undefined for rpmfusion for fc40
+ #
+ #CODE="
#include <linux/mm.h>
- void conftest_follow_pfn(void) {
- follow_pfn();
- }"
+ #void conftest_follow_pfn(void) {
+ # follow_pfn();
+ #}"
- compile_check_conftest "$CODE" "NV_FOLLOW_PFN_PRESENT" "" "functions"
+ #compile_check_conftest "$CODE" "NV_FOLLOW_PFN_PRESENT" "" "functions"
+ echo "#undef NV_FOLLOW_PFN_PRESENT" | append_conftest "functions"
;;
i2c_adapter)
diff --git a/kernel/nvidia/os-mlock.c b/kernel/nvidia/os-mlock.c
index ad5cb9a..a59cb9f 100644
--- a/kernel/nvidia/os-mlock.c
+++ b/kernel/nvidia/os-mlock.c
@@ -20,8 +20,10 @@ static inline int nv_follow_pfn(struct vm_area_struct *vma,
{
#if defined(NV_UNSAFE_FOLLOW_PFN_PRESENT)
return unsafe_follow_pfn(vma, address, pfn);
-#else
+##elif defined(NV_FOLLOW_PFN_PRESENT)
return follow_pfn(vma, address, pfn);
+#else
+ return -1;
#endif
}
--
2.46.0