On Wed, 2008-07-02 at 22:53 -0300, Henrique de Moraes Holschuh wrote: > Hmm, it could cause deadlocks I think. task context takes lock. > interrupt context tries to run, needs lock, keeps spinning forever > waiting for it, and if we are not SMP, task context never has a chance > to release the lock, so we get a deadlock. Is this correct? Never heard of spin_lock_irqsave()? > If it is, we better make the atomic path lock-free. Argh. This means > rfkill->state (the only thing we care about in the atomic path) would > have to become an atomic variable, and the code changed to cope with > its value being "volatile", so that it can be used in a lockless > fashion. Yup, if protecting rfkill->state is the only intention, a spinlock is too heavy. set|clear_bit is enough if organizing the state into bitmaps. BTW, read/write 32-bits aligned on x86 is already atomic. Thanks, -yi -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html