[packages/xorg-driver-video-nvidia-legacy-340xx] - fix building with kernel 5.3

baggins baggins at pld-linux.org
Wed Sep 18 19:13:36 CEST 2019


commit f878b4de1d53e8fc67decb43bdba1e7c9bfdbaa6
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Sep 18 19:12:32 2019 +0200

    - fix building with kernel 5.3

 kernel-5.3.patch                           | 62 ++++++++++++++++++++++++++++++
 xorg-driver-video-nvidia-legacy-340xx.spec |  4 +-
 2 files changed, 65 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-340xx.spec b/xorg-driver-video-nvidia-legacy-340xx.spec
index ee4f537..91fe92b 100644
--- a/xorg-driver-video-nvidia-legacy-340xx.spec
+++ b/xorg-driver-video-nvidia-legacy-340xx.spec
@@ -25,7 +25,7 @@ exit 1
 
 %define		no_install_post_check_so 1
 
-%define		rel	3
+%define		rel	4
 %define		pname	xorg-driver-video-nvidia-legacy-340xx
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
 Summary(hu.UTF-8):	Linux meghajtók nVidia GeForce/Quadro chipekhez
@@ -50,6 +50,7 @@ Patch1:		X11-driver-nvidia-desktop.patch
 Patch2:		linux-4.0.patch
 Patch3:		kernel-4.4.169.patch
 Patch4:		kernel-5.0.patch
+Patch5:		kernel-5.3.patch
 URL:		http://www.nvidia.com/object/unix.html
 BuildRequires:	rpmbuild(macros) >= 1.701
 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
@@ -254,6 +255,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
diff --git a/kernel-5.3.patch b/kernel-5.3.patch
new file mode 100644
index 0000000..8c6f50e
--- /dev/null
+++ b/kernel-5.3.patch
@@ -0,0 +1,62 @@
+From df6b6227e19b46cf23abca790570804872cbf87c Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone at canonical.com>
+Date: Tue, 13 Aug 2019 11:20:39 +0200
+Subject: [PATCH 1/1] Add support for Linux 5.3
+
+smp_call_function() and on_each_cpu() no longer have return values
+as per commit caa759323c73676b3e48c8d9c86093c88b4aba97
+---
+ nv-linux.h | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/nv-linux.h b/nv-linux.h
+index 4043bf1..62f0874 100644
+--- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-linux.h
++++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-linux.h
+@@ -877,12 +877,21 @@ extern void *nv_stack_t_cache;
+         __ret;                                               \
+      })
+ #elif (NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT == 3)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
+ #define NV_SMP_CALL_FUNCTION(func, info, wait)               \
+     ({                                                       \
+         int __ret = smp_call_function(func, info, wait);     \
+         __ret;                                               \
+      })
+ #else
++#define NV_SMP_CALL_FUNCTION(func, info, wait)               \
++    ({                                                       \
++        int __ret = 0;                                       \
++        smp_call_function(func, info, wait);                 \
++        __ret;                                               \
++     })
++#endif
++#else
+ #error "NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT value unrecognized!"
+ #endif
+ #elif defined(CONFIG_SMP)
+@@ -897,12 +906,21 @@ extern void *nv_stack_t_cache;
+         __ret;                                         \
+      })
+ #elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
+ #define NV_ON_EACH_CPU(func, info, wait)               \
+     ({                                                 \
+         int __ret = on_each_cpu(func, info, wait);     \
+         __ret;                                         \
+      })
+ #else
++#define NV_ON_EACH_CPU(func, info, wait)               \
++    ({                                                 \
++        int __ret = 0;                                 \
++        on_each_cpu(func, info, wait);                 \
++        __ret;                                         \
++    })
++#endif
++#else
+ #error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!"
+ #endif
+ #elif defined(CONFIG_SMP)
+-- 
+2.20.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-340xx.git/commitdiff/f878b4de1d53e8fc67decb43bdba1e7c9bfdbaa6



More information about the pld-cvs-commit mailing list