|
From: Jake H. <jh...@an...> - 2004-10-17 00:47:09
|
Daniel Gryniewicz wrote: > > Great work. I especially like the atomic_add(..., -1) -> atomic_dec(). > Some of those old uses were quite scary... I'm not surprised we had SMP > issues. > > I didn't notice anything wrong with the patch. You might want to > consider a few new local variables, where consecutive atomic_read()'s > occure on the same variable. For example, this hunk: > > It seems quite possible that p_nCount gets changed between the reads. > It would only cause printing problems, but could make debugging harder, > and should be easy to fix. Yeah, I noticed that too, but didn't want to change too much at once. Anyway, here are my patches to the kernel/drivers directory for the new primitives (install the new headers from my last patch with "make dist" before compiling). One nice thing was that several of the drivers were Linux ports that used the atomic_*() macros properly, so all I had to do for them was comment out the compatibility macros in "linuxcomp.h". I also fixed all the compiler warnings except for a single "implicit declaration of function 'ffs'" warning in sound/emu10k1/src/ac97_codec.c since I didn't know what header file to include and I'm not even sure whether ffs() can be called by drivers since it doesn't seem to be exported by the kernel. Actually, I'm a bit suspicious of the emu10k1 driver since I had to add atomic versions of test_bit() and set_bit() from Linux to emu_wrapper.h. The current version was using atomic_and() in efxmgr.c when it should have been using test_bit(). Unfortunately, I don't have access to an EMU10K1 based sound card so I have no way of testing my changes. -- Jake |