Re: spin_lock doesn't work?!?
From: Josh Boyer <hidden>
Date: 2007-08-30 11:53:13
On Wed, 29 Aug 2007 23:30:22 -0700 (PDT) melinda develey [off-list ref] wrote:
>You should still put the spin_lock calls into your code because >youquoted
never know if someone else will compile it and for another >target. If someone would, for example, compile the same code for a SMP >machine then the spin_lock will actually lock.I used the spinlock both in an interrupt handler to protect a group of variables (because in an interrupt I can't use a semaphore) and the same spinlock in a ioctl handler where the same group of variables is accessed. Is this wrong? I have a 2.6.19.2 linux kernel.
You might want to use spin_lock_irq instead. That will disable interrupts in the critical section in the ioctl. Seems more like what you are trying to do. josh