aboutsummaryrefslogtreecommitdiff
path: root/system/nvidia-legacy304-kernel/disable-mtrr.patch
blob: 326c287ec391460cea51692709224eaea99722f3 (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
Author: Luca Boccassi <luca.boccassi@gmail.com>
Description: Disable MTRR on kernel >= 4.3
 From kernel 4.3 and newer (commit 2baa891e42d84) mtrr_add and mtrr_del are no
 longer exported. The Nvidia kernel shim still uses it as of 304.131, causing
 the module to error out when loading. Disable MTRR if running on 4.3 or greater
 until upstream fixes it.

--- a/nv-linux.h
+++ b/nv-linux.h
@@ -256,6 +256,15 @@
 #include <linux/seq_file.h>
 #endif
 
+/*
+ * As of version 304.131, os-agp.c and os-mtrr.c still use deprecated
+ * kernel APIs for mtrr which are no longer exported since 4.3, causing
+ * the module to error out when loaded.
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+#undef CONFIG_MTRR
+#endif
+
 #if !defined(NV_VMWARE) && defined(CONFIG_MTRR)
 #include <asm/mtrr.h>
 #endif