Re: FW: spinlocks dont work

From: Jamie Lokier
Date: Fri Feb 13 2004 - 20:28:55 EST


RANDAZZO@xxxxxxxxxxx wrote:
> Note the following example:
>
> driver 'A' calls spin_lock_irqsave and gets through (but does not call
> ..unlock).
> driver 'B' calls spin_lock_irqsave and gets through???
>
> How can B get through if A did not unlock yet?

Is that code from B an interrupt handler?
If yes, then A should have called spin_lock_irqsave()

Otherwise, is that code from B a softirq or tasklet or timer handler?
If yes, then A should have called spin_lock_bh()

Otherwise, that code from B cannot run unless you are calling
schedule() from A after taking the lock, which is a bug in your code.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/