aboutsummaryrefslogtreecommitdiff
path: root/system/nvidia-legacy390-kernel/kernel-5.14.patch
blob: bb8440d2cce3984b6475261cc377dece7b922804 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff -Nur kernel.orig/nvidia/nvlink_linux.c kernel/nvidia/nvlink_linux.c
--- kernel.orig/nvidia/nvlink_linux.c	2021-06-02 19:10:01.000000000 -0400
+++ kernel/nvidia/nvlink_linux.c	2021-07-21 00:54:04.940862052 -0400
@@ -21,6 +21,7 @@
 
 *******************************************************************************/
 
+#include <linux/version.h>
 #include "conftest.h"
 
 #include "nvlink_common.h"
@@ -597,7 +598,12 @@
         // the requested timeout has expired, loop until less
         // than a jiffie of the desired delay remains.
         //
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
         current->state = TASK_INTERRUPTIBLE;
+#else
+        // Rel. commit "sched: Change task_struct::state" (Peter Zijlstra, Jun 11 2021)
+        WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
+#endif
         do
         {
             schedule_timeout(jiffies);
diff -Nur kernel.orig/nvidia/os-interface.c kernel/nvidia/os-interface.c
--- kernel.orig/nvidia/os-interface.c	2021-06-02 19:09:57.000000000 -0400
+++ kernel/nvidia/os-interface.c	2021-07-21 00:54:31.512104423 -0400
@@ -8,6 +8,7 @@
  * _NVRM_COPYRIGHT_END_
  */
 
+#include <linux/version.h>
 #define  __NO_VERSION__
 #include "nv-misc.h"
 
@@ -580,7 +581,12 @@
         // the requested timeout has expired, loop until less
         // than a jiffie of the desired delay remains.
         //
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
         current->state = TASK_INTERRUPTIBLE;
+#else
+        // Rel. commit "sched: Change task_struct::state" (Peter Zijlstra, Jun 11 2021)
+        WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
+#endif
         do
         {
             schedule_timeout(jiffies);
diff -Nur kernel.orig/nvidia-drm/nvidia-drm-drv.c kernel/nvidia-drm/nvidia-drm-drv.c
--- kernel.orig/nvidia-drm/nvidia-drm-drv.c	2021-06-02 19:10:01.000000000 -0400
+++ kernel/nvidia-drm/nvidia-drm-drv.c	2021-07-21 02:56:07.552121923 -0400
@@ -20,6 +20,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
+
 #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
 
 #include "nvidia-drm-priv.h"
@@ -811,7 +813,9 @@
 
     dev->dev_private = nv_dev;
     nv_dev->dev = dev;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
     dev->pdev = pdev;
+#endif
 
     /* Register DRM device to DRM sub-system */