Re: Oops with spin_lock() in an IRQF_NO_THREAD interrupt
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2013-10-04 12:42:59
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2013-10-04 12:42:59
* Matthias Klein | 2013-10-02 14:54:00 [+0000]:
Hello,
Hi,
i am writing a kernel module on a rt kernel where I have an IRQF_NO_THREAD interrupt.
I hope you know what you are doing with this.
For sharing a "write index" between that interrupt and the process context (ioctl() etc.) I use a spin_lock for locking. In the IRQ I use spin_lock() & spin_unlock(), and in the process context I use spin_lock_irq() & spin_unlock_irq(). Basically the driver and the test application are working, but after some time I get an oops message. Do I use the right functions for locking ? Do you have a tip why I get that oops message ?
You should use a the raw_spinlock here if you _really_ need IRQF_NO_THREAD.
Best regards, Matthias
Sebastian