cannot compile nvidia driver for Linux 5.5.0 proc_create_data(..., fops, __data) error

Any patch for this? I’m on NVIDIA-Linux-x86_64-440.44.run

Thanks,
Jeff

compiling nvidia [5.5.0] …
make[1]: Entering directory ‘/v6/src2/linux/linux’
CC [M] /v6/src/nvidia/kernel/nvidia/nv-procfs.o
In file included from /v6/src/nvidia/kernel/nvidia/nv-procfs.c:19:
/v6/src/nvidia/kernel/nvidia/nv-procfs.c: In function ‘nv_procfs_add_text_file’:
/v6/src/nvidia/kernel/common/inc/nv-procfs.h:38:60: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatibl e-pointer-types]
__entry = proc_create_data(filename, mode, parent, fops, __data);\
^~~~
/v6/src/nvidia/kernel/nvidia/nv-procfs.c:1226:5: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
NV_CREATE_PROC_FILE(filename, parent, text_file, (void *)text);
^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
from /v6/src/nvidia/kernel/common/inc/nv-linux.h:184,
from /v6/src/nvidia/kernel/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
^~~~~~~~~~~~~~~~

Me too

In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c: In function ‘nv_procfs_add_text_file’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incom
patible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:681:5: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  681 |     NV_CREATE_PROC_FILE(filename, parent, text_file, (void *)text);
      |     ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c: In function ‘nv_register_procfs’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:735:13: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  735 |     entry = NV_CREATE_PROC_FILE("params", proc_nvidia, params, NULL);
      |             ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:739:13: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  739 |     entry = NV_CREATE_PROC_FILE("registry", proc_nvidia, registry, NULL);
      |             ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:760:13: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  760 |     entry = NV_CREATE_PROC_FILE("version", proc_nvidia, version, NULL);
      |             ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c: In function ‘nv_procfs_add_gpu’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:803:13: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  803 |     entry = NV_CREATE_PROC_FILE("information", proc_nvidia_gpu, gpu_info,
      |             ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:808:13: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  808 |     entry = NV_CREATE_PROC_FILE("registry", proc_nvidia_gpu, registry, nv);
      |             ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:814:17: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  814 |         entry = NV_CREATE_PROC_FILE("exercise_error_forwarding", proc_nvidia_gpu,
      |                 ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:290,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:62:64: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   62 |         __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
      |                                                                ^~~~
      |                                                                |
      |                                                                const struct file_operations *
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-procfs.h:39:42: note: in definition of macro ‘NV_CREATE_PROC_ENTRY’
   39 |     proc_create_data(name, mode, parent, fops, __data)
      |                                          ^~~~
/var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:822:17: note: in expansion of macro ‘NV_CREATE_PROC_FILE’
  822 |         entry = NV_CREATE_PROC_FILE("unbindLock", proc_nvidia_gpu, unbind_lock, nv);
      |                 ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/efi.h:19,
                 from /var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:196,
                 from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-procfs.c:15:
./include/linux/proc_fs.h:59:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
   59 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
   ./tools/objtool/objtool check  --module --retpoline --uaccess /var/lib/dkms/nvidia/390.132/build/nvidia/nv-usermap.o

You’re attempting to build against the current master branch of the Linux source, right? If that’s the case, I’d recommend changing the title to something along the lines of: “Cannot compile NVIDIA driver on the Linux 5.6-rc1 release candidate”

As for a patch, I’ve made an initial version for 440.59. Although it should apply just fine to the older 440.44 version, too, you’d also need the 5.5 compatibility patch in that case.

Downloadable 5.5 patch: NVIDIA 440.44 - Kernel 5.5-rc1 Patch ($1923197) · Snippets · Snippets · GitLab
Downloadable 5.6 patch: NVIDIA 440.59 - Kernel 5.6 Patch ($1937313) · Snippets · Snippets · GitLab

diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
index e235842..805e525 100644
--- a/kernel/common/inc/nv-linux.h
+++ b/kernel/common/inc/nv-linux.h
@@ -531,7 +531,11 @@ static inline void *nv_ioremap(NvU64 phys, NvU64 size)
 
 static inline void *nv_ioremap_nocache(NvU64 phys, NvU64 size)
 {
+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
     void *ptr = ioremap_nocache(phys, size);
+#else
+    void *ptr = ioremap(phys, size);
+#endif
     if (ptr)
         NV_MEMDBG_ADD(ptr, size);
     return ptr;
diff --git a/kernel/common/inc/nv-procfs.h b/kernel/common/inc/nv-procfs.h
index 8b53f86..4c5aceb 100644
--- a/kernel/common/inc/nv-procfs.h
+++ b/kernel/common/inc/nv-procfs.h
@@ -28,6 +28,18 @@
 
 #define IS_EXERCISE_ERROR_FORWARDING_ENABLED() (EXERCISE_ERROR_FORWARDING)
 
+#if defined(NV_HAVE_PROC_OPS)
+#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
+   ({                                                                    \
+        struct proc_dir_entry *__entry;                                  \
+        int mode = (S_IFREG | S_IRUGO);                                  \
+        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
+        if (fops->proc_write != 0)                                       \
+            mode |= S_IWUSR;                                             \
+        __entry = proc_create_data(filename, mode, parent, fops, __data);\
+        __entry;                                                         \
+    })
+#else
 #define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
    ({                                                                    \
         struct proc_dir_entry *__entry;                                  \
@@ -38,6 +50,7 @@
         __entry = proc_create_data(filename, mode, parent, fops, __data);\
         __entry;                                                         \
     })
+#endif
 
 /*
  * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
@@ -77,6 +90,44 @@
     remove_proc_entry(entry->name, entry->parent);
 #endif
 
+#if defined(NV_HAVE_PROC_OPS)
+#define NV_DEFINE_SINGLE_PROCFS_FILE(name, open_callback, close_callback)     \
+    static int nv_procfs_open_##name(                                         \
+        struct inode *inode,                                                  \
+        struct file *filep                                                    \
+    )                                                                         \
+    {                                                                         \
+        int ret;                                                              \
+        ret = single_open(filep, nv_procfs_read_##name,                       \
+                          NV_PDE_DATA(inode));                                \
+        if (ret < 0)                                                          \
+        {                                                                     \
+            return ret;                                                       \
+        }                                                                     \
+        ret = open_callback();                                                \
+        if (ret < 0)                                                          \
+        {                                                                     \
+            single_release(inode, filep);                                     \
+        }                                                                     \
+        return ret;                                                           \
+    }                                                                         \
+                                                                              \
+    static int nv_procfs_release_##name(                                      \
+        struct inode *inode,                                                  \
+        struct file *filep                                                    \
+    )                                                                         \
+    {                                                                         \
+        close_callback();                                                     \
+        return single_release(inode, filep);                                  \
+    }                                                                         \
+                                                                              \
+    static const struct proc_ops nv_procfs_##name##_fops = {                  \
+        .proc_open       = nv_procfs_open_##name,                             \
+        .proc_read       = seq_read,                                          \
+        .proc_lseek      = seq_lseek,                                         \
+        .proc_release    = nv_procfs_release_##name,                          \
+    };
+#else
 #define NV_DEFINE_SINGLE_PROCFS_FILE(name, open_callback, close_callback)     \
     static int nv_procfs_open_##name(                                         \
         struct inode *inode,                                                  \
@@ -114,6 +165,7 @@
         .llseek     = seq_lseek,                                              \
         .release    = nv_procfs_release_##name,                               \
     };
+#endif
 
 #endif  /* CONFIG_PROC_FS */
 
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 57d85a4..4902248 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -780,6 +780,22 @@ compile_test() {
             compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
         ;;
 
+        ioremap_nocache)
+            #
+            # Determine if the ioremap_nocache() function is present.
+            #
+            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
+            # devm_ioremap_nocache") in v5.6 (2020-01-06)
+            #
+            CODE="
+            #include <asm/io.h>
+            void conftest_ioremap_nocache(void) {
+                ioremap_nocache();
+            }"
+
+            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
+        ;;
+
         ioremap_wc)
             #
             # Determine if the ioremap_wc() function is present.
@@ -806,6 +822,16 @@ compile_test() {
             compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_IOCTL" "" "types"
         ;;
 
+        proc_ops)
+            CODE="
+            #include <linux/proc_fs.h>
+            int conftest_proc_ops(void) {
+                return offsetof(struct proc_ops, proc_open);
+            }"
+
+            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
+        ;;
+
         sg_alloc_table)
             #
             # sg_alloc_table_from_pages added by commit efc42bc98058
diff --git a/kernel/nvidia/nv-procfs.c b/kernel/nvidia/nv-procfs.c
index 064d727..a7308d3 100644
--- a/kernel/nvidia/nv-procfs.c
+++ b/kernel/nvidia/nv-procfs.c
@@ -452,6 +452,15 @@ done:
     return ((status < 0) ? status : (int)count);
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static struct proc_ops nv_procfs_registry_fops = {
+    .proc_open    = nv_procfs_open_registry,
+    .proc_read    = seq_read,
+    .proc_write   = nv_procfs_write_file,
+    .proc_lseek   = seq_lseek,
+    .proc_release = nv_procfs_close_registry,
+};
+#else
 static struct file_operations nv_procfs_registry_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_registry,
@@ -460,6 +469,7 @@ static struct file_operations nv_procfs_registry_fops = {
     .llseek  = seq_lseek,
     .release = nv_procfs_close_registry,
 };
+#endif
 
 #if defined(CONFIG_PM)
 static int
@@ -531,6 +541,15 @@ nv_procfs_open_suspend_depth(
     return single_open(file, nv_procfs_show_suspend_depth, NULL);
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static struct proc_ops nv_procfs_suspend_depth_fops = {
+    .proc_open    = nv_procfs_open_suspend_depth,
+    .proc_read    = seq_read,
+    .proc_write   = nv_procfs_write_suspend_depth,
+    .proc_lseek   = seq_lseek,
+    .proc_release = single_release
+};
+#else
 static struct file_operations nv_procfs_suspend_depth_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_suspend_depth,
@@ -539,6 +558,7 @@ static struct file_operations nv_procfs_suspend_depth_fops = {
     .llseek  = seq_lseek,
     .release = single_release
 };
+#endif
 
 static int
 nv_procfs_show_suspend(
@@ -613,6 +633,15 @@ nv_procfs_open_suspend(
     return single_open(file, nv_procfs_show_suspend, NULL);
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static struct proc_ops nv_procfs_suspend_fops = {
+    .proc_open    = nv_procfs_open_suspend,
+    .proc_read    = seq_read,
+    .proc_write   = nv_procfs_write_suspend,
+    .proc_lseek   = seq_lseek,
+    .proc_release = single_release
+};
+#else
 static struct file_operations nv_procfs_suspend_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_suspend,
@@ -622,6 +651,7 @@ static struct file_operations nv_procfs_suspend_fops = {
     .release = single_release
 };
 #endif
+#endif
 
 /*
  * Forwards error to nv_log_error which exposes data to vendor callback
@@ -724,12 +754,20 @@ done:
     return status;
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static struct proc_ops nv_procfs_exercise_error_forwarding_fops = {
+    .proc_open    = nv_procfs_open_exercise_error_forwarding,
+    .proc_write   = nv_procfs_write_file,
+    .proc_release = nv_procfs_close_exercise_error_forwarding,
+};
+#else
 static struct file_operations nv_procfs_exercise_error_forwarding_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_exercise_error_forwarding,
     .write   = nv_procfs_write_file,
     .release = nv_procfs_close_exercise_error_forwarding,
 };
+#endif
 
 static int
 nv_procfs_read_unbind_lock(
@@ -851,6 +889,15 @@ done:
     return rc;
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static struct proc_ops nv_procfs_unbind_lock_fops = {
+    .proc_open    = nv_procfs_open_unbind_lock,
+    .proc_read    = seq_read,
+    .proc_write   = nv_procfs_write_file,
+    .proc_lseek   = seq_lseek,
+    .proc_release = nv_procfs_close_unbind_lock,
+};
+#else
 static struct file_operations nv_procfs_unbind_lock_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_unbind_lock,
@@ -859,6 +906,7 @@ static struct file_operations nv_procfs_unbind_lock_fops = {
     .llseek  = seq_lseek,
     .release = nv_procfs_close_unbind_lock,
 };
+#endif
 
 static const char*
 numa_status_describe(nv_numa_status_t state)
@@ -1187,6 +1235,22 @@ done:
     return retval;
 }
 
+#if defined(NV_HAVE_PROC_OPS)
+static const struct proc_ops nv_procfs_numa_status_fops = {
+    .proc_open    = nv_procfs_open_numa_status,
+    .proc_read    = seq_read,
+    .proc_write   = nv_procfs_write_file,
+    .proc_lseek   = seq_lseek,
+    .proc_release = nv_procfs_close_numa_status,
+};
+
+static const struct proc_ops nv_procfs_offline_pages_fops = {
+    .proc_open    = nv_procfs_open_offline_pages,
+    .proc_read    = seq_read,
+    .proc_lseek   = seq_lseek,
+    .proc_release = nv_procfs_close_offline_pages,
+};
+#else
 static const struct file_operations nv_procfs_numa_status_fops = {
     .owner   = THIS_MODULE,
     .open    = nv_procfs_open_numa_status,
@@ -1203,6 +1267,7 @@ static const struct file_operations nv_procfs_offline_pages_fops = {
     .llseek  = seq_lseek,
     .release = nv_procfs_close_offline_pages,
 };
+#endif
 
 static int
 nv_procfs_read_text_file(
diff --git a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
index 5ec3e65..2897e31 100644
--- a/kernel/nvidia/nvidia.Kbuild
+++ b/kernel/nvidia/nvidia.Kbuild
@@ -104,6 +104,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_memory_array_uc
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += acquire_console_sem
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += console_lock
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_cache
+NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_nocache
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_wc
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_walk_namespace
 NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_alloc_table
@@ -150,6 +151,7 @@ NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_swiotlb_dma_ops
 NV_CONFTEST_TYPE_COMPILE_TESTS += acpi_op_remove
 NV_CONFTEST_TYPE_COMPILE_TESTS += outer_flush_all
 NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations
+NV_CONFTEST_TYPE_COMPILE_TESTS += proc_ops
 NV_CONFTEST_TYPE_COMPILE_TESTS += file_inode
 NV_CONFTEST_TYPE_COMPILE_TESTS += kuid_t
 NV_CONFTEST_TYPE_COMPILE_TESTS += dma_ops
diff --git a/kernel/nvidia/os-interface.c b/kernel/nvidia/os-interface.c
index 07f1b77..a8f1d85 100644
--- a/kernel/nvidia/os-interface.c
+++ b/kernel/nvidia/os-interface.c
@@ -477,9 +477,15 @@ NV_STATUS NV_API_CALL os_get_current_time(
 
 void NV_API_CALL os_get_current_tick(NvU64 *nseconds)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
+    struct timespec64 ts;
+
+    jiffies_to_timespec64(jiffies, &ts);
+#else
     struct timespec ts;
 
     jiffies_to_timespec(jiffies, &ts);
+#endif
 
     *nseconds = ((NvU64)ts.tv_sec * NSEC_PER_SEC + (NvU64)ts.tv_nsec);
 }

Isaak,

I didn’t see your patch earlier, so I went ahead and another patch.
I’ve tested and it’s worked. Here’s the patch.

I’m still on NVIDIA-Linux-x86_64-440.44

https://github.com/jeffersonchua/nvidia-patches/blob/master/patch-procfs

My best.,
Jeff

No problem, glad it worked.

Functionally I see no real difference, except that the other patch does away with backwards compatibility, and it’s missing a fix for commit 751addac78b6 (“y2038: remove obsolete jiffies conversion functions”). You might need that when 5.6-rc1 releases proper.

There is a new comment by Isaak.Aleksandrov on one of the threads you are following:

Functionally I see no real difference, except that the other patch does away with backwards compatibility, and it’s missing a fix for commit 751addac78b6 (“y2038: remove obsolete jiffies conversion functions”). You might need that when 5.6-rc1 releases proper.

Isaak,

Thank you! I’ll use your patch then.

My best.,
Jeff

Hi, Isaak.
I am using nvidia-390.132 version for my NVIDIA Corporation GF119 [NVS 310] (version a1)
5.5 patch: NVIDIA 440.44 - Kernel 5.5-rc1 Patch ($1923197) · Snippets · Snippets · GitLab applied, but the driver did not assemble.

patch -p2 < kernel-5.5.patch 
patching file common/inc/nv-drm.h
patching file conftest.sh
Hunk #1 succeeded at 1678 (offset 528 lines).
Hunk #2 succeeded at 2269 (offset 485 lines).
Hunk #3 succeeded at 2389 with fuzz 1 (offset 475 lines).
Hunk #4 succeeded at 2417 (offset 475 lines).
Hunk #5 succeeded at 2437 (offset 475 lines).
Hunk #6 succeeded at 2456 (offset 475 lines).
Hunk #7 succeeded at 2487 (offset 475 lines).
Hunk #8 succeeded at 3630 with fuzz 1 (offset 521 lines).
Hunk #9 succeeded at 3651 with fuzz 1 (offset 521 lines).
Hunk #10 succeeded at 3672 with fuzz 1 (offset 521 lines).
patching file nvidia-drm/nvidia-drm-connector.c
patching file nvidia-drm/nvidia-drm-connector.h
patching file nvidia-drm/nvidia-drm-crtc.h
patching file nvidia-drm/nvidia-drm-drv.c
patching file nvidia-drm/nvidia-drm-encoder.h
patching file nvidia-drm/nvidia-drm-fb.h
patching file nvidia-drm/nvidia-drm-gem.h
patching file nvidia-drm/nvidia-drm-helper.c
patching file nvidia-drm/nvidia-drm-helper.h
patching file nvidia-drm/nvidia-drm-modeset.h
patching file nvidia-drm/nvidia-drm-os-interface.h
patching file nvidia-drm/nvidia-drm-prime-fence.h
patching file nvidia-drm/nvidia-drm-priv.h
patching file nvidia-drm/nvidia-drm-utils.h
nvidia"' -c -o /var/lib/dkms/nvidia/390.132/build/nvidia/nv-dma.o /var/lib/dkms/nvidia/390.132/build/nvidia/nv-dma.c
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv.c:13:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-frontend.c:13:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-instance.c:13:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-gpu-numa.c:24:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-acpi.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-chrdev.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
cc1: some warnings being treated as errors
In file included from /var/lib/dkms/nvidia/390.132/build/nvidia/nv-cray.c:15:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h: In function ‘nv_ioremap_nocache’:
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-We
rror=implicit-function-declaration]
  556 |     void *ptr = ioremap_nocache(phys, size);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/var/lib/dkms/nvidia/390.132/build/common/inc/nv-linux.h:556:17: warning: initialization of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wi
nt-conversion]
make[2]: *** [scripts/Makefile.build:268: /var/lib/dkms/nvidia/390.132/build/nvidia/nv-instance.o] Error 1

You’re trying to compile on the 5.6 kernel, right? Judging by the error: “error: implicit declaration of function ‘ioremap_nocache’”
In that case, you’d need both the base fixes for 5.5, and the fixes for the 5.6 release candidate. The patch for 440.59 doesn’t seem to apply cleanly onto the 390.132 driver version, however.

This is completely untested, but consider giving this one a shot instead:
https://gitlab.com/snippets/1942075

Edit:
And in case you’re not, then you can just replace the “ioremap_nocache” call in “common/inc/nv-linux.h” with plain “ioremap” – without the “_nocache” bit.

You’re trying to compile on the 5.6 kernel, right?
kernel 5.5.4

This does not work

And in case you’re not, then you can just replace the “ioremap_nocache” call in “common/inc/nv-linux.h” with plain “ioremap” – without the “_nocache” bit.

That’s odd. The error looks like the driver is being built on 5.6, and the driver builds fine on 5.5.4 on my end.

Have you tried the new patch I posted? And if so, did the error remain the same with that one?

If you do try it, then you would only need the new one. No need to use both.

[quote=“”]

patch -p2 < kernel-5.6.patch

patching file common/inc/nv-linux.h
Hunk #1 succeeded at 553 (offset 22 lines).
patching file common/inc/nv-procfs.h
Hunk #1 succeeded at 52 with fuzz 2 (offset 24 lines).
Hunk #2 succeeded at 75 with fuzz 1 (offset 25 lines).
Hunk #3 FAILED at 90.
Hunk #4 succeeded at 134 with fuzz 2 (offset 7 lines).
1 out of 4 hunks FAILED -- saving rejects to file common/inc/nv-procfs.h.rej
patching file conftest.sh
Hunk #1 succeeded at 1189 (offset 409 lines).
Hunk #2 succeeded at 1400 with fuzz 1 (offset 578 lines).
patching file nvidia/nv-procfs.c
Hunk #1 succeeded at 414 (offset -38 lines).
Hunk #2 succeeded at 431 with fuzz 2 (offset -38 lines).
Hunk #3 FAILED at 541.
Hunk #4 succeeded at 533 with fuzz 2 (offset -16 lines).
Hunk #5 FAILED at 624.
Hunk #6 succeeded at 711 with fuzz 2 (offset 78 lines).
Hunk #7 FAILED at 736.
Hunk #8 FAILED at 863.
Hunk #9 FAILED at 871.
Hunk #10 FAILED at 1199.
Hunk #11 FAILED at 1215.
7 out of 11 hunks FAILED -- saving rejects to file nvidia/nv-procfs.c.rej
patching file nvidia/nvidia.Kbuild
Hunk #1 succeeded at 117 with fuzz 2 (offset 13 lines).
Hunk #2 FAILED at 151.
1 out of 2 hunks FAILED -- saving rejects to file nvidia/nvidia.Kbuild.rej
patching file nvidia/os-interface.c
Hunk #1 succeeded at 444 (offset -33 lines).

Right, so that definitely shouldn’t be happening.The patch should’ve applied cleanly, without any errors or warnings.

What distribution are you running, and how are you building the driver? And are you applying any other patches along this one?

Also, I’ll be off for a bit shortly, so sorry to say, but I probably won’t be of much more use in tracking this issue down.

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.10
DISTRIB_CODENAME=eoan
DISTRIB_DESCRIPTION="Ubuntu 19.10"

dkms install -m nvidia -v 390.132 -k 5.5.4

Kernel preparation unnecessary for this kernel.  Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching file Kbuild
Hunk #1 succeeded at 79 (offset 8 lines).

applying patch do-not-call-pci_save_state.patch...patching file nvidia/nv.c

Building module:
cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j8 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.5.4-sa-haswell IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.5.4-sa-haswell/build LD=/usr/bin/ld.bfd modules.....(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.5.4-sa-haswell is not supported
Error! Bad return status for module build on kernel: 5.5.4-sa-haswell (x86_64)
Consult /var/lib/dkms/nvidia/390.132/build/make.log for more information.

The 5.5 patch apply’s almost fine on 390.132, my gt630M I needed it :)

Hunk #1 FAILED at 36.

Only issue seems to be:

In file included from /var/lib/dkms/nvidia/390.132/build/nvidia-drm/nvidia-drm.c:27:
/var/lib/dkms/nvidia/390.132/build/nvidia-drm/nvidia-drm-priv.h:30:10: fatal error: nv-drm.h: No such file or directory
30 | #include “nv-drm.h”

compilation terminated.
scripts/Makefile.build:265: recipe for target ‘/var/lib/dkms/nvidia/390.132/build/nvidia-drm/nvidia-drm.o’ failed
make[2]: *** [/var/lib/dkms/nvidia/390.132/build/nvidia-drm/nvidia-drm.o] Error 1
make[2]: *** Waiting for unfinished jobs…
Makefile:1693: recipe for target ‘/var/lib/dkms/nvidia/390.132/build’ failed
make[1]: *** [/var/lib/dkms/nvidia/390.132/build] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-5.5.0-050500-generic’
Makefile:81: recipe for target ‘modules’ failed
make: *** [modules] Error 2

Edit:

Added this to .manifest

kernel/common/inc/nv-drm.h 00644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman

Now it works :)

However enabling nvidia-drm panics here :)

Call Trace:
[ 5.992883] nv_drm_atomic_helper_disable_all+0xed/0x290 [nvidia_drm]
[ 5.992888] nv_drm_master_drop+0x28/0x60 [nvidia_drm]
[ 5.992909] drm_drop_master+0x22/0x30 [drm]
[ 5.992923] drm_master_release+0xac/0xb0 [drm]
[ 5.992938] drm_file_free.part.0+0x229/0x290 [drm]
[ 5.992953] drm_release+0xb3/0xf0 [drm]
[ 5.992957] __fput+0xcc/0x260
[ 5.992959] ____fput+0xe/0x10
[ 5.992962] task_work_run+0x8f/0xb0
[ 5.992966] exit_to_usermode_loop+0x131/0x160
[ 5.992969] do_syscall_64+0x170/0x1b0
[ 5.992972] entry_SYSCALL_64_after_hwframe+0x44/0xa9
5.992975] RIP: 0033:0x7f48e4c1c8d4
[ 5.992977] Code: eb 89 e8 cf 43 02 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8d 05 31 00 2e 00 8b 00 85 c0 75 13 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3c f3 c3 66 90 53 89 fb 48 83 ec 10 e8 f4 fd
[ 5.992978] RSP: 002b:00007fff2d44e668 EFLAGS: 00000246 ORIG_RAX: 00000000000 00003
[ 5.992980] RAX: 0000000000000000 RBX: 00005640c4320be0 RCX: 00007f48e4c1c8d4
[ 5.992982] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
[ 5.992983] RBP: 00007fff2d44e6f0 R08: 00005640c4320ae0 R09: 000000000000000a
[ 5.992984] R10: 00000000fffffff6 R11: 0000000000000246 R12: 00005640c2cd3ea0
[ 5.992985] R13: 00007fff2d44e970 R14: 0000000000000000 R15: 0000000000000000
[ 5.992988] —[ end trace 62a66051fb12c982 ]—

Also for Ubuntu, Linux Mint etc, notebook users with intel + nvidia also need to install the nvidia-prime package, “sudo apt-get install nvidia-prime”.

And also: PPA for Aaron Plattner : Aaron Plattner

I’m not really sure which patch you’re referring to, but the latest ones I’ve posted should compile fine:
5.5: NVIDIA 390.132 - Kernel 5.5 ($1943814) · Snippets · GitLab
5.6: NVIDIA 390.132 - Kernel 5.6 ($1943873) · Snippets · GitLab
I’m not sure what patches Ubuntu(?) bundles, so if there’s any “Hunk #x FAILED at y”, remove whatever other patches you got and only use that one.

Edit: That’s what I’ve got for being slow, I guess. The call trace isn’t really a “panic”, no? That’s an old issue that others have been posting quite a bit about. Check the forums for:

Ah, i somehow got to use a older patch file!

The call trace is indeed not a panic, as the system still works fine :)

@Isaak.Aleksandrov IMHO the 5.6 patch you provided does not work for the actual 5.6.0 final release (Ubuntu 64bit):

$ sh NVIDIA-Linux-x86_64-440.64.run -x
Creating directory NVIDIA-Linux-x86_64-440.64
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 440.64.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
$ cd NVIDIA-Linux-x86_64-440.64
$ patch -p1 -i ~/Downloads/kernel-5.6.patch
patching file kernel/common/inc/nv-linux.h
Hunk #1 FAILED at 553.
1 out of 1 hunk FAILED -- saving rejects to file kernel/common/inc/nv-linux.h.rej
patching file kernel/common/inc/nv-procfs.h
Hunk #1 succeeded at 28 with fuzz 2 (offset -24 lines).
Hunk #2 succeeded at 51 with fuzz 1 (offset -25 lines).
Hunk #3 FAILED at 118.
Hunk #4 succeeded at 128 with fuzz 2 (offset -7 lines).
1 out of 4 hunks FAILED -- saving rejects to file kernel/common/inc/nv-procfs.h.rej
patching file kernel/common/inc/nv-time.h
Hunk #1 succeeded at 27 with fuzz 2 (offset -3 lines).
Hunk #2 succeeded at 41 (offset -3 lines).
patching file kernel/conftest.sh
Hunk #1 succeeded at 780 (offset -417 lines).
Hunk #2 succeeded at 836 with fuzz 1 (offset -610 lines).
patching file kernel/nvidia-modeset/nvidia-modeset-linux.c
Hunk #1 succeeded at 266 (offset 50 lines).
patching file kernel/nvidia-uvm/uvm_linux.h
Hunk #1 succeeded at 301 (offset -28 lines).
Hunk #2 succeeded at 326 (offset -28 lines).
patching file kernel/nvidia/nv-procfs.c
Hunk #1 succeeded at 452 (offset 38 lines).
Hunk #2 succeeded at 469 with fuzz 2 (offset 38 lines).
Hunk #3 succeeded at 734 (offset 207 lines).
Hunk #4 succeeded at 869 (offset 201 lines).
Hunk #5 succeeded at 886 with fuzz 2 (offset 201 lines).
patching file kernel/nvidia/nvidia.Kbuild
Hunk #1 succeeded at 104 with fuzz 2 (offset -13 lines).
Hunk #2 FAILED at 170.
1 out of 2 hunks FAILED -- saving rejects to file kernel/nvidia/nvidia.Kbuild.rej
patching file kernel/nvidia/nvlink_linux.c
Hunk #1 succeeded at 513 (offset -5 lines).
Hunk #2 succeeded at 523 (offset -5 lines).
Hunk #3 succeeded at 539 (offset -5 lines).
Hunk #4 succeeded at 561 (offset -5 lines).
patching file kernel/nvidia/os-interface.c
Hunk #1 succeeded at 463 (offset 33 lines).
Hunk #2 succeeded at 477 (offset 33 lines).
Hunk #3 succeeded at 555 (offset 47 lines).
Hunk #4 succeeded at 595 (offset 47 lines).
Hunk #5 succeeded at 1960 (offset 28 lines).

The 5.6 patch fails with the actual 5.6.0 kernel release.

Let me know if I can help.

@jeanmarc.leroux The patch you’ve linked is for the 390.132 version of the drivers, while according to the log, you’re patching version 440.64. If you’re patching the latter, 440.64, then you should try this one: NVIDIA 440.64 - Kernel 5.6 ($1945940) · Snippets · Snippets · GitLab
Could you please verify which patch you’re actually using, and see if the one linked above works.

New issue on linux-5.6.0 latest git pull (commit 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94) …
CC [M] /v6/src/nvidia/kernel/nvidia/nv-vm.o
/v6/src/nvidia/kernel/nvidia/nv-vm.c: In function ‘nv_set_memory_array_type’:
/v6/src/nvidia/kernel/nvidia/nv-vm.c:66:13: error: implicit declaration of function ‘set_memory_array_uc’; did you mean ‘set_pages_array_uc’? [-Werror=implicit-function-declaration]
set_memory_array_uc(pages, num_pages);
^~~~~~~~~~~~~~~~~~~
set_pages_array_uc
/v6/src/nvidia/kernel/nvidia/nv-vm.c:69:13: error: implicit declaration of function ‘set_memory_array_wb’; did you mean ‘set_pages_array_wb’? [-Werror=implicit-function-declaration]
set_memory_array_wb(pages, num_pages);
^~~~~~~~~~~~~~~~~~~
set_pages_array_wb

Any patch for this?

Thanks,
Jeff

@jeff.chua.linux Giving the source a quick check, those calls should already be in a conftest-based if check – #if defined(NV_SET_MEMORY_ARRAY_UC_PRESENT). At least 440 and 390 has that check in place, so there shouldn’t, at least as far as I can see, be any problems relating to that.

And while I don’t actually have the latest master kernel ready for testing, I can see that a919198b97c85e093c81eaae0b4864206ec2fe02 was the commit that removed the functions. Running git branch --contains on that commit shows that 5.5 should’ve had it as well, so it really shouldn’t be a problem with the latest master either.

What driver version are you compiling?

Edit: At least on my end, there seems to be some weirdness with the kernel includes. If that’s the actual cause, or it’s my particular branch that’s got some wonky commit, I couldn’t say. Anyway, the hacky way of working around it in the meantime would be to simply undef the test.

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 8f807a1..af29636 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -143,6 +143,7 @@ test_headers() {
     FILES="$FILES video/nv_internal.h"
     FILES="$FILES asm/book3s/64/hash-64k.h"
     FILES="$FILES asm/set_memory.h"
+    FILES="$FILES asm/pgtable.h"
     FILES="$FILES asm/prom.h"
     FILES="$FILES asm/powernv.h"
     FILES="$FILES asm/tlbflush.h"
@@ -466,6 +467,9 @@ compile_test() {
             # It does not exist on all architectures.
             #
             CODE="
+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
+            #include <asm/pgtable.h>
+            #endif
             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
             #include <asm/set_memory.h>
             #else