View Single Post
Old 04-28-09, 01:08 PM   #1
ibuclaw
Registered User
 
Join Date: Apr 2009
Posts: 5
Lightbulb NVIDIA Driver on Pre-Emptive/Realtime Kernels

Hi,

I'm currently testing the installation of the 185.19 drivers under a realtime optimised kernel for ubuntustudio, version 2.6.28-3-rt, for a friend you was having trouble building the driver on his machine.

The driver fails to build because of the following problem.
/tmp/selfgz6048/NVIDIA-Linux-x86_64-185.19-pkg2/usr/src/nv/os-interface.c:130: error: incompatible types in assignment

The line where it fails being:
Code:
spin_lock_init(&os_sema->lock);
I have traced this down and discovered the reason why this happens is because this kernel was built with the pre-emptive kernel option set as 'full', as opposed to being turned 'off' (servers) or 'partial' (desktops).

I created the following patch, which seems to fix the issue:
Code:
--- nv/os-interface.c	2009-04-28 18:58:23.112878241 +0100
+++ nv.new/os-interface.c	2009-04-28 18:55:05.000000000 +0100
@@ -127,7 +127,11 @@
     os_sema = (os_sema_t *)*ppSema;
     os_sema->sp = sp;
     init_completion(&os_sema->completion);
+#ifdef CONFIG_PREEMPT_RT
+    rt_spin_lock_init(&os_sema->lock);
+#else
     spin_lock_init(&os_sema->lock);
+#endif
     os_sema->count = 1;
 
     return RM_OK;
I have had a look at the most recent beta, and the code appears to be the same in this section. So I am presuming that it will too fail to build from source.

Am I likely to expect this patch being submitted upstream?

[EDIT]
For clarification, you can turn on the pre-emptive kernel option in the make menuconfig listing:
'Processor type and features ---> Preemption Model (Preemptible Kernel)'
and set it to the bottom option (Low-Latency Desktop).

Regards
Iain
ibuclaw is offline   Reply With Quote