Skip to contentSkip to conversation

patch for NVIDIA on -rt

PATCH Joakim Hernberg 2 participants 2 messages Aug 16, 2010

lore
Share & tools
lore
#0 lore raw

For those that might need it.

Quoted 1 line

From bff65cf087bae512ae9f485f4556e89d304f99a9 Mon Sep 17 00:00:00 2001

From: Joakim B Hernberg <[email protected]>
Date: Sun, 8 Aug 2010 12:39:34 +0200
Subject: [PATCH] Patch nvidia proprietary video driver 256.44 for rt patched kernel 2.6.33.7-rt29

---
 kernel/nv-linux.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
kernel/nv-linux.h +9 -9
index 3ba43e7..e95460a 100644
@@ -218,16 +218,16 @@ extern int nv_pat_mode;
 #endif
 
 #if defined(CONFIG_PREEMPT_RT)
-typedef atomic_spinlock_t         nv_spinlock_t;
-#define NV_SPIN_LOCK_INIT(lock)   atomic_spin_lock_init(lock)
-#define NV_SPIN_LOCK_IRQ(lock)    atomic_spin_lock_irq(lock)
-#define NV_SPIN_UNLOCK_IRQ(lock)  atomic_spin_unlock_irq(lock)
-#define NV_SPIN_LOCK_IRQSAVE(lock,flags) atomic_spin_lock_irqsave(lock,flags)
+typedef raw_spinlock_t         nv_spinlock_t;
+#define NV_SPIN_LOCK_INIT(lock)   raw_spin_lock_init(lock)
+#define NV_SPIN_LOCK_IRQ(lock)    raw_spin_lock_irq(lock)
+#define NV_SPIN_UNLOCK_IRQ(lock)  raw_spin_unlock_irq(lock)
+#define NV_SPIN_LOCK_IRQSAVE(lock,flags) raw_spin_lock_irqsave(lock,flags)
 #define NV_SPIN_UNLOCK_IRQRESTORE(lock,flags) \
-  atomic_spin_unlock_irqrestore(lock,flags)
-#define NV_SPIN_LOCK(lock)        atomic_spin_lock(lock)
-#define NV_SPIN_UNLOCK(lock)      atomic_spin_unlock(lock)
-#define NV_SPIN_UNLOCK_WAIT(lock) atomic_spin_unlock_wait(lock)
+  raw_spin_unlock_irqrestore(lock,flags)
+#define NV_SPIN_LOCK(lock)        raw_spin_lock(lock)
+#define NV_SPIN_UNLOCK(lock)      raw_spin_unlock(lock)
+#define NV_SPIN_UNLOCK_WAIT(lock) raw_spin_unlock_wait(lock)
 #else
 typedef spinlock_t                nv_spinlock_t;
 #define NV_SPIN_LOCK_INIT(lock)   spin_lock_init(lock)
@@ -791,7 +791,7 @@ static inline int nv_execute_on_all_cpus(void (*func)(void 

*info), void *info)
}

#if defined(CONFIG_PREEMPT_RT)
-#define NV_INIT_MUTEX(mutex) semaphore_init(mutex) +#define NV_INIT_MUTEX(mutex) sema_init(mutex,1)
#else
#if !defined(__SEMAPHORE_INITIALIZER) &&
defined(__COMPAT_SEMAPHORE_INITIALIZER)
#define __SEMAPHORE_INITIALIZER __COMPAT_SEMAPHORE_INITIALIZER

Signature · 1 line
1.7.2.1
#1 lore raw
Quoted 10 lines · Joakim Hernberg

For those that might need it.

Quoted 1 line

From bff65cf087bae512ae9f485f4556e89d304f99a9 Mon Sep 17 00:00:00 2001

From: Joakim B Hernberg<[email protected]>
Date: Sun, 8 Aug 2010 12:39:34 +0200
Subject: [PATCH] Patch nvidia proprietary video driver 256.44 for rt patched kernel 2.6.33.7-rt29

---
  kernel/nv-linux.h |   20 ++++++++++----------

That patch works for me here. Thank you.

I had to do a little web searching to find out how to use this patch and, though I'm probably the only one on this list who was ignorant of this procedure, I'll share it here just in case it's useful:

1. Extract the NVidia source:

     ./NVIDIA-Linux-x86-256.44.run -x

2. Apply the patch:

cd [path]/NVIDIA-Linux-x86-256.44/kernel
patch < [PathToPatchFile]/[PatchFilename]
cd ..

3. Build the driver:

    ./nvidia-installer -K --kernel-name=2.6.33.7-rt29