[nvidia-340xx-kmod] Patch for kernel-5.11.0 Cleaning up kernel-5.7.0 patch
by Thaison Nguyen
commit 2a9e1cc6e06b18d16585c07429562fe41ef4725b
Author: Thaison Nguyen <thieson08(a)me.com>
Date: Mon Mar 1 09:20:45 2021 +0100
Patch for kernel-5.11.0
Cleaning up kernel-5.7.0 patch
kernel-5.11.patch | 6 ++++--
kernel-5.7.patch | 36 ++++++++++++------------------------
nvidia-340xx-kmod.spec | 4 ++++
3 files changed, 20 insertions(+), 26 deletions(-)
---
diff --git a/kernel-5.11.patch b/kernel-5.11.patch
index be2a2f1..5a24317 100644
--- a/kernel-5.11.patch
+++ b/kernel-5.11.patch
@@ -1,25 +1,27 @@
diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h
--- a/kernel/nv-linux.h 2021-02-23 20:01:52.429999710 +0100
+++ b/kernel/nv-linux.h 2021-02-23 14:48:00.163333638 +0100
-@@ -119,7 +119,8 @@
+@@ -119,7 +119,9 @@
#include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
#include <linux/cpu.h> /* CPU hotplug support */
#endif
-#include <asm/kmap_types.h> /* page table entry lookup */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
+ #include <asm/kmap_types.h> /* page table entry lookup */
++#endif
#include <linux/pci.h> /* pci_find_class, etc */
#include <linux/interrupt.h> /* tasklets, interrupt helpers */
--- a/kernel/uvm/nvidia_uvm_linux.h 2019-12-11 17:04:24.000000000 -0500
+++ b/kernel/uvm/nvidia_uvm_linux.h 2021-02-24 06:26:26.237367942 -0500
-@@ -141,7 +141,8 @@
+@@ -141,7 +141,9 @@
#if !defined(NV_VMWARE)
#include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
#endif
-#include <asm/kmap_types.h> /* page table entry lookup */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
+ #include <asm/kmap_types.h> /* page table entry lookup */
++#endif
#include <linux/interrupt.h> /* tasklets, interrupt helpers */
#include <linux/timer.h>
diff --git a/kernel-5.7.patch b/kernel-5.7.patch
index 3917f38..f4fa5ec 100644
--- a/kernel-5.7.patch
+++ b/kernel-5.7.patch
@@ -1,5 +1,4 @@
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 125a690..2597080 100644
+diff -Naur a/kernel/Makefile b/kernel/Makefile
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -108,12 +108,14 @@ COMPILE_TESTS = \
@@ -34,8 +33,7 @@ index 125a690..2597080 100644
drm_legacy_pci_init \
timer_setup \
do_gettimeofday \
-diff --git a/kernel/conftest.sh b/kernel/conftest.sh
-index b7a85f0..a5225e5 100755
+diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -176,6 +176,7 @@ test_headers() {
@@ -161,8 +159,7 @@ index b7a85f0..a5225e5 100755
drm_legacy_pci_init)
#
# Determine if drm_legacy_pci_init() is present. drm_pci_init() was
-diff --git a/kernel/dkms.conf b/kernel/dkms.conf
-index 79a02ae..3140f03 100644
+diff -Naur a/kernel/dkms.conf b/kernel/dkms.conf
--- a/kernel/dkms.conf
+++ b/kernel/dkms.conf
@@ -1,7 +1,13 @@
@@ -180,8 +177,7 @@ index 79a02ae..3140f03 100644
+MAKE[0]="make -j$num_cpu_cores module KERNEL_UNAME=${kernelver}"
CLEAN="make clean"
AUTOINSTALL="yes"
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 0d1cdbf..85db07e 100644
+diff -Naur a/kernel/nv-drm.c b/kernel/nv-drm.c
--- a/kernel/nv-drm.c
+++ b/kernel/nv-drm.c
@@ -50,9 +50,236 @@
@@ -422,8 +418,7 @@ index 0d1cdbf..85db07e 100644
#endif
extern nv_linux_state_t *nv_linux_devices;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index a1d2c68..83e6433 100644
+diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -688,11 +688,16 @@ extern nv_spinlock_t km_lock;
@@ -522,8 +517,7 @@ index a1d2c68..83e6433 100644
#endif /* CONFIG_PROC_FS */
-diff --git a/kernel/nv-procfs.c b/kernel/nv-procfs.c
-index ebca3e8..9365c3c 100644
+diff -Naur a/kernel/nv-procfs.c b/kernel/nv-procfs.c
--- a/kernel/nv-procfs.c
+++ b/kernel/nv-procfs.c
@@ -409,6 +409,15 @@ done:
@@ -574,8 +568,7 @@ index ebca3e8..9365c3c 100644
static int
nv_procfs_read_text_file(
-diff --git a/kernel/nv-time.h b/kernel/nv-time.h
-index a34ceb2..780f8bc 100644
+diff -Naur a/kernel/nv-time.h b/kernel/nv-time.h
--- a/kernel/nv-time.h
+++ b/kernel/nv-time.h
@@ -28,7 +28,12 @@
@@ -601,8 +594,7 @@ index a34ceb2..780f8bc 100644
.tv_sec = now.tv_sec,
.tv_usec = now.tv_nsec/1000,
};
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a167be9..a218f83 100644
+diff -Naur a/kernel/nv.c b/kernel/nv.c
--- a/kernel/nv.c
+++ b/kernel/nv.c
@@ -752,7 +752,7 @@ int __init nvidia_init_module(void)
@@ -614,8 +606,7 @@ index a167be9..a218f83 100644
if (nv_stack_t_cache == NULL)
{
nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-diff --git a/kernel/os-interface.c b/kernel/os-interface.c
-index 7190b26..0c0dc05 100644
+diff -Naur a/kernel/os-interface.c b/kernel/os-interface.c
--- a/kernel/os-interface.c
+++ b/kernel/os-interface.c
@@ -439,7 +439,7 @@ RM_STATUS NV_API_CALL os_get_current_time(
@@ -648,8 +639,7 @@ index 7190b26..0c0dc05 100644
#endif
nv_gettimeofday(&tm_aux);
-diff --git a/kernel/uvm/Makefile b/kernel/uvm/Makefile
-index 0cad8ff..043a08d 100644
+diff -Naur a/kernel/uvm/Makefile b/kernel/uvm/Makefile
--- a/kernel/uvm/Makefile
+++ b/kernel/uvm/Makefile
@@ -207,6 +207,7 @@ ccflags-y += $(EXTRA_CFLAGS)
@@ -660,8 +650,7 @@ index 0cad8ff..043a08d 100644
module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
-diff --git a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
-index b7a85f0..33e2a63 100755
+diff -Naur a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
--- a/kernel/uvm/conftest.sh
+++ b/kernel/uvm/conftest.sh
@@ -176,6 +176,7 @@ test_headers() {
@@ -682,8 +671,7 @@ index b7a85f0..33e2a63 100755
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
#include <asm/set_memory.h>
#else
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 6943e7c..9a7e3b6 100644
+diff -Naur a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
--- a/kernel/uvm/nvidia_uvm_lite.c
+++ b/kernel/uvm/nvidia_uvm_lite.c
@@ -131,8 +131,8 @@ static
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index c511e19..5ffce9b 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -86,6 +86,10 @@ done
%{?akmod_install}
%changelog
+* Mon Mar 01 2021 Thaison Nguyen <thieson08(a)me.com> - 1:340.108-12
+- Patch for kernel-5.11.0
+- Cleaning up kernel-5.7.0 patch
+
* Thu Feb 04 2021 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> - 1:340.108-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
3 years, 9 months
[nvidia-340xx-kmod] Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
by Thaison Nguyen
commit 6f636a2d215cd3e633b504d60ffc02e7019d8b56
Author: Thaison Nguyen <thieson08(a)me.com>
Date: Mon Mar 1 08:34:37 2021 +0100
Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
kernel-5.11.patch | 25 +++++++++++++++++++++++++
nvidia-340xx-kmod.spec | 4 +++-
2 files changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/kernel-5.11.patch b/kernel-5.11.patch
new file mode 100644
index 0000000..be2a2f1
--- /dev/null
+++ b/kernel-5.11.patch
@@ -0,0 +1,25 @@
+diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h
+--- a/kernel/nv-linux.h 2021-02-23 20:01:52.429999710 +0100
++++ b/kernel/nv-linux.h 2021-02-23 14:48:00.163333638 +0100
+@@ -119,7 +119,8 @@
+ #include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
+ #include <linux/cpu.h> /* CPU hotplug support */
+ #endif
+-#include <asm/kmap_types.h> /* page table entry lookup */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
++ #include <asm/kmap_types.h> /* page table entry lookup */
+
+ #include <linux/pci.h> /* pci_find_class, etc */
+ #include <linux/interrupt.h> /* tasklets, interrupt helpers */
+--- a/kernel/uvm/nvidia_uvm_linux.h 2019-12-11 17:04:24.000000000 -0500
++++ b/kernel/uvm/nvidia_uvm_linux.h 2021-02-24 06:26:26.237367942 -0500
+@@ -141,7 +141,8 @@
+ #if !defined(NV_VMWARE)
+ #include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
+ #endif
+-#include <asm/kmap_types.h> /* page table entry lookup */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
++ #include <asm/kmap_types.h> /* page table entry lookup */
+
+ #include <linux/interrupt.h> /* tasklets, interrupt helpers */
+ #include <linux/timer.h>
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index dd3e182..c511e19 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -12,7 +12,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.108
# Taken over by kmodtool
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -24,6 +24,7 @@ Patch1: kernel-5.7.patch
Patch2: kernel-5.8.patch
Patch3: kernel-5.9.patch
Patch4: kernel-5.10.patch
+Patch5: kernel-5.11.patch
BuildRequires: elfutils-libelf-devel
BuildRequires: gcc
@@ -54,6 +55,7 @@ tar --use-compress-program xz -xf %{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
%patch0 -p1
for kernel_version in %{?kernel_versions} ; do
3 years, 9 months