spin_is_locked() broken for uniprocessor?

Alan Cox alan at lxorguk.ukuu.org.uk
Wed Aug 19 20:53:01 EST 2009


On Wed, 19 Aug 2009 10:38:06 +0100
David Howells <dhowells at redhat.com> wrote:

> Thomas Gleixner <tglx at linutronix.de> wrote:
> 
> > > which implies to me that spin_is_locked() will always return false.  Is this
> > > expected behavior.
> > 
> > That's wrong. spin_is_locked should always return true on UP.
> 
> Surely it's not that simple?  Maybe spin_is_lock() should be undefined on UP.

That would lead to a lot of

#ifdef CONFIG_SMP

#endif

in drivers because there is driver code that uses spin_is_locked() in
fairly sensible fashion when dealing with locking.


More information about the Linuxppc-dev mailing list