commit 425e9ce06d39031f0ad07a8aaf5f1684bf865d93
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sun Apr 23 10:14:23 2017 +0100
patch for kernel-4.11rc
4.11_kernel.patch | 112 +++++++++++++++++++++++++++++++++++++++++++++++++
nvidia-340xx-kmod.spec | 7 +++-
2 files changed, 118 insertions(+), 1 deletion(-)
---
diff --git a/4.11_kernel.patch b/4.11_kernel.patch
new file mode 100644
index 0000000..5ee3e4f
--- /dev/null
+++ b/4.11_kernel.patch
@@ -0,0 +1,112 @@
+--- a/kernel/nv-drm.c
++++ b/kernel/nv-drm.c
+@@ -22,6 +22,8 @@
+ #include <drm/drm_gem.h>
+ #endif
+
++#include <linux/version.h>
++
+ extern nv_linux_state_t *nv_linux_devices;
+
+ struct nv_gem_object {
+@@ -48,7 +50,11 @@
+ return -ENODEV;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ static int nv_drm_unload(
++#else
++static void nv_drm_unload(
++#endif
+ struct drm_device *dev
+ )
+ {
+@@ -60,11 +66,19 @@
+ {
+ BUG_ON(nvl->drm != dev);
+ nvl->drm = NULL;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ return 0;
++#else
++ return;
++#endif
+ }
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ return -ENODEV;
++#else
++ return;
++#endif
+ }
+
+ static void nv_gem_free(
+
+--- a/kernel/uvm/nvidia_uvm_linux.h
++++ b/kernel/uvm/nvidia_uvm_linux.h
+@@ -124,6 +124,9 @@
+ #include <linux/delay.h> /* mdelay, udelay */
+
+ #include <linux/sched.h> /* suser(), capable() replacement */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/moduleparam.h> /* module_param() */
+ #if !defined(NV_VMWARE)
+ #include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
+@@ -362,6 +365,7 @@
+ void address_space_init_once(struct address_space *mapping);
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ #if !defined(NV_FATAL_SIGNAL_PENDING_PRESENT)
+ static inline int __fatal_signal_pending(struct task_struct *p)
+ {
+@@ -372,6 +376,7 @@
+ {
+ return signal_pending(p) && __fatal_signal_pending(p);
+ }
++#endif
+ #endif
+
+ //
+
+--- a/kernel/uvm/nvidia_uvm_lite.c
++++ b/kernel/uvm/nvidia_uvm_lite.c
+@@ -818,7 +818,11 @@
+ }
+
+ #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++int _fault(struct vm_fault *vmf)
++#else
+ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++#endif
+ {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+ unsigned long vaddr = (unsigned long)vmf->virtual_address;
+@@ -828,7 +832,11 @@
+ struct page *page = NULL;
+ int retval;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
++#else
+ retval = _fault_common(vma, vaddr, &page, vmf->flags);
++#endif
+
+ vmf->page = page;
+
+@@ -866,7 +874,11 @@
+ // it's dealing with anonymous mapping (see handle_pte_fault).
+ //
+ #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++int _sigbus_fault(struct vm_fault *vmf)
++#else
+ int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++#endif
+ {
+ vmf->page = NULL;
+ return VM_FAULT_SIGBUS;
+
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index cd2324d..972c586 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -10,7 +10,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.102
# Taken over by kmodtool
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -20,6 +20,7 @@ Source11: nvidia-kmodtool-excludekernel-filterfile
Patch0: nv-linux-arm.patch
Patch1: 4.9.0_kernel.patch
Patch2: 4.10.0_kernel.patch
+Patch3: 4.11_kernel.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -50,6 +51,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -97,6 +99,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Sun Apr 23 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1:340.102-3
+- patch for kernel-4.11rc
+
* Mon Feb 20 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1:340.102-2
- patch for kernel-4.10