Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 09-25-09, 05:42 PM   #1
bluesscream
Registered User
 
Join Date: Jul 2007
Posts: 7
Default 173.14.20 driver in 2.6.31-x-rt kernel?

173.14.20 driver now works fine with all 2.6.31-x-generic kernels but I was not able to install it in real-time-kernels. (Ubuntu 9.10 SMP PREEMPT RT x86_64 on amd64x2 4400, 4G, Geforce FX5200)
patches/workarounds/suggestions would be appreciated.
Best regards bluesscream
bluesscream is offline   Reply With Quote
Old 10-03-09, 04:33 AM   #2
eskuai
Registered User
 
Join Date: Aug 2007
Posts: 35
Default Re: 173.14.20 driver in 2.6.31-x-rt kernel?

On Sat, 2009-09-12 at 11:24 +0200, Jan Engelhardt wrote:
> For interested parties and archival, patches to the four nvidia packages
> (185, 173, 96, 71) for 2.6.31-rt.
> Tested {2.6.31-rc8-rt9 with 96}, which seems to work.

Adding on patch for nvidia-beta (currently at 190.36, also worked for
190.32). Tested against 2.6.31-rt11.

diff -Naur nv.orig/nv-linux.h nv/nv-linux.h
--- nv-linux.h 2009-09-02 18:42:19.000000000 +0800
+++ nv-linux.h 2009-09-22 19:31:12.285960428 +0800
@@ -743,7 +743,7 @@
#define nv_up(lock) up(&lock)

#if defined(CONFIG_PREEMPT_RT)
-#define NV_INIT_MUTEX(mutex) init_MUTEX(mutex)
+#define NV_INIT_MUTEX(mutex) semaphore_init(mutex)
#else
#if !defined(__SEMAPHORE_INITIALIZER) &&
defined(__COMPAT_SEMAPHORE_INITIALIZER)
#define __SEMAPHORE_INITIALIZER __COMPAT_SEMAPHORE_INITIALIZER
diff -Naur nv.orig/os-interface.c nv/os-interface.c
--- os-interface.c 2009-09-02 18:42:17.000000000 +0800
+++ os-interface.c 2009-09-22 19:35:25.977961345 +0800
@@ -109,9 +109,15 @@
nv_stack_t *sp;
struct completion completion;
#if defined(CONFIG_PREEMPT_RT)
- raw_spinlock_t lock;
+ atomic_spinlock_t lock;
+#define nv_spin_lock_init(x) atomic_spin_lock_init(x)
+#define nv_spin_lock_irqsave(x, f) atomic_spin_lock_irqsave((x), (f))
+#define nv_spin_unlock_irqrestore(x, f)
atomic_spin_unlock_irqrestore((x), (f))
#else
spinlock_t lock;
+#define nv_spin_lock_init(x) spin_lock_init(x)
+#define nv_spin_lock_irqsave(x, f) spin_lock_irqsave((x), (f))
+#define nv_spin_unlock_irqrestore(x, f) spin_unlock_irqrestore((x),
(f))
#endif
S032 count;
} os_sema_t;
@@ -148,7 +154,7 @@
os_sema = (os_sema_t *)*ppSema;
os_sema->sp = sp;
init_completion(&os_sema->completion);
- spin_lock_init(&os_sema->lock);
+ nv_spin_lock_init(&os_sema->lock);
os_sema->count = 1;

if (nv_os_smp_barrier_init())
@@ -199,18 +205,18 @@
os_sema_t *os_sema = (os_sema_t *)pSema;
unsigned long old_irq;

- spin_lock_irqsave(&os_sema->lock, old_irq);
+ nv_spin_lock_irqsave(&os_sema->lock, old_irq);
if (os_sema->count <= 0)
{
os_sema->count--;
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);
wait_for_completion(&os_sema->completion);
}
else
{
os_sema->count--;
rm_disable_interrupts(os_sema->sp);
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);
}

return RM_OK;
@@ -233,17 +239,17 @@
os_sema_t *os_sema = (os_sema_t *)pSema;
unsigned long old_irq;

- spin_lock_irqsave(&os_sema->lock, old_irq);
+ nv_spin_lock_irqsave(&os_sema->lock, old_irq);
if (os_sema->count <= 0)
{
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);
return RM_ERROR;
}
else
{
os_sema->count--;
rm_disable_interrupts(os_sema->sp);
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);
return RM_OK;
}

@@ -267,7 +273,7 @@
unsigned long old_irq;
BOOL doWakeup;

- spin_lock_irqsave(&os_sema->lock, old_irq);
+ nv_spin_lock_irqsave(&os_sema->lock, old_irq);
if (os_sema->count < 0)
{
doWakeup = TRUE;
@@ -278,7 +284,7 @@
rm_enable_interrupts(os_sema->sp);
}
os_sema->count++;
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);

if (doWakeup)
complete(&os_sema->completion);
@@ -1383,7 +1389,7 @@
unsigned long oldIrql;

os_sema = (os_sema_t *) pSema;
- spin_lock_irqsave(&os_sema->lock, oldIrql);
+ nv_spin_lock_irqsave(&os_sema->lock, oldIrql);

return oldIrql;
}
@@ -1394,7 +1400,7 @@
unsigned long old_irq = (unsigned long) oldIrql;

os_sema = (os_sema_t *) pSema;
- spin_unlock_irqrestore(&os_sema->lock, old_irq);
+ nv_spin_unlock_irqrestore(&os_sema->lock, old_irq);
}

RM_STATUS NV_API_CALL os_get_address_space_info(
eskuai is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:43 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.