やるきなし

2019/09/20 14:45 / nvidia-kernel-dkms 418.74-1 with Linux 5.3

以下の nvidia のドライバが Linux 5.3 でコンパイルできない話.

具体的には以下のエラー.

In file included from /var/lib/dkms/nvidia-current/418.74/build/nvidia/nv_uvm_interface.c:21:
/var/lib/dkms/nvidia-current/418.74/build/nvidia/nv_uvm_interface.c: In function ‘nvUvmInterfaceDeRegisterUvmOps’:
/var/lib/dkms/nvidia-current/418.74/build/common/inc/nv-linux.h:733:21: error: void value not ignored as it ought to be
         int __ret = on_each_cpu(func, info, 1);        \
                     ^~~~~~~~~~~
/var/lib/dkms/nvidia-current/418.74/build/nvidia/nv_uvm_interface.c:991:5: note: in expansion of macro ‘NV_ON_EACH_CPU’
     NV_ON_EACH_CPU(flush_top_half, NULL);
     ^~~~~~~~~~~~~~

これは smp: Remove smp_call_function() and on_each_cpu() return valueson_each_cpu が値を返さなくなったということなので,マクロでダミーの正常時の戻り値を作ってしまえばOK.以下パッチ.nvidia-legacy-390xx-kernel-dkms も同様.

--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -730,8 +730,8 @@ static inline void nv_vunmap(NvUPtr vaddr, NvU32 page_count)
 #elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3)
 #define NV_ON_EACH_CPU(func, info)                     \
     ({                                                 \
-        int __ret = on_each_cpu(func, info, 1);        \
-        __ret;                                         \
+        on_each_cpu(func, info, 1);                    \
+        0;                                             \
      })
 #else
 #error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!"

Related articles