Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 308945 - All current x11-drivers/nvidia-driver versions break with new linux-2.6.33-rt patch series
Summary: All current x11-drivers/nvidia-driver versions break with new linux-2.6.33-rt...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal with 1 vote (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-11 08:29 UTC by filip
Modified: 2010-04-20 14:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Defines nv_spinlock_t as raw_spinlock_t (nvidia-drivers-190.53-2.6.33-rt.patch,1.46 KB, patch)
2010-03-11 10:41 UTC, filip
Details | Diff
New patch version (nvidia-drivers-190.53-2.6.33-rt.patch,1.96 KB, patch)
2010-03-11 15:10 UTC, filip
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description filip 2010-03-11 08:29:21 UTC
When I tried to emerge nvidia-drivers for a freshly compiled linux-2.6.33-rt4 I got this error:
In file included from
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r1/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv.c:14:
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r1/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv-linux.h:202:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nv_spinlock_t'
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r1/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv-linux.h:1282:
error: expected specifier-qualifier-list before 'nv_spinlock_t'

...followed by reams of more of the same.

When I opened nv-linux.h and checked the offending line, I found:
#if defined(CONFIG_PREEMPT_RT)
typedef atomic_spinlock_t         nv_spinlock_t;

So I got suspicious and grepped the rt-patch for atomic_spinlock_t - and it's gone. I unmasked nvidia-drivers-195.36.03 and tried that too, but the same problem there.

Until upstream comes out with a new version, or someone patches the old one - nvidia-drivers do not work on linux-2.6.33-rt kernels. 

Reproducible: Always

Steps to Reproduce:
1. Install a 2.6.33-rt-series kernel.
2. Emerge nvidia-drivers
3. Watch the fireworks

Actual Results:  
Return lots of lines of compiler errors.

Expected Results:  
Compiled the drivers.

It seems the rt-kernels have changed how the work with spinlocks, so atomic_spinlock_t is obsoleted. I'm not quite sure what has replaced it though, so I don't quite want to start testing stuff just yet. Haven't found a good resource on rt spinlocks in this version, and the one on LWN (mentioning atomic_spinlock_t) is obviously obsoleted.
Comment 1 filip 2010-03-11 10:41:58 UTC
Created attachment 223131 [details, diff]
Defines nv_spinlock_t as raw_spinlock_t

Snooping around, I found that the atomic_spinlock_t (and associated functions) have changed names to raw_spinlock_t (etc). So I created a patch (enclosed) to fix the name change. Next, there obviously are some other compilation errors:

/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r2/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv.c: In function 'nv_alloc_file_private':
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r2/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv.c:2012: error: implicit declaration of function 'semaphore_init'
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r2/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv.c: In function 'nv_kern_open':
/var/tmp/portage/x11-drivers/nvidia-drivers-190.53-r2/work/NVIDIA-Linux-x86_64-190.53-pkg2/usr/src/nv/nv.c:2188: warning: initialization from incompatible pointer type

It would seem that I have to patch nv-linux.h some more to get nvidia-drivers to work on the 2.6.33-rt kernels.
Comment 2 filip 2010-03-11 15:10:48 UTC
Created attachment 223153 [details, diff]
New patch version

This patch resolves the last compilation problem. It applies against both 190 and 195 versions of the driver. Alas, it does not work. X hangs on startup without meaningful errors in the log.
Comment 3 Alex Montgomery 2010-03-22 20:56:14 UTC
I haven't compared the two patches, but the patch referenced on the Nvidia forum here:
http://www.nvnews.net/vbulletin/showthread.php?t=148509

compiles *and* runs fine for me. Give it a go.
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2010-03-24 14:00:40 UTC
We don't support the rt kernel. gentoo-sources and vanilla-sources are the only supported kernels.
Comment 5 filip 2010-03-25 21:58:44 UTC
So, if you're not supporting this bug - I suppose you will resolve it as WONTFIX. That's a pity since the patch in the forum is working for me too (with a 195 series kernel).

The only problem is that the linked patch isn't making the header file take kernel version into account. If there is interest I could fix it up to that end - and otherwise I could just go on using the patch in my own /usr/local/portage. Or is there an overlay for which it is appropriate?
Comment 6 th0th696 2010-04-20 08:07:49 UTC
It would be very nice, if a solutions was found, for that to be in the pro-audio overlay.
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2010-04-20 14:37:52 UTC
You guys are more than welcome to maintain patches in an overlay. Nothing is stopping you.