Add missing spin_lock_irqsave_nested
PATCH 1/1 Add missing spin_lock_irqsave_nested
Hi,
the latest tree has a change in net/irda/irlmp.c that uses the lockdep annotation spin_lock_irqsave_nested. The only problem is that the irqsave variant doesn't exists at the moment.
The attached patch is an attempt to fix this. It is only compile tested and I hope that I did everything right. Please double-check, because I don't touch these parts of the kernel code very often.
Regards
Marcel
[PATCH] Add missing spin_lock_irqsave_nested
This patch adds the missing spin_lock_irqsave_nested annotation which is used by net/irda/irlmp.c now.
---
commit 45896a1478804f8849f670dd5ff9dd436a811009
tree 53b1f451f04b45c324178b06e8d386f2f3d2fb60
parent 1abbfb412b1610ec3a7ec0164108cee01191d9f5
author Marcel Holtmann <[email protected]> Fri, 24 Nov 2006 11:02:41 +0100 committer Marcel Holtmann <[email protected]> Fri, 24 Nov 2006 11:02:41 +0100
include/linux/spinlock.h | 2 ++ include/linux/spinlock_api_smp.h | 2 ++ include/linux/spinlock_api_up.h | 1 + 3 files changed, 5 insertions(+), 0 deletions(-)
include/linux/spinlock.h +2 -0
@@ -175,8 +175,10 @@ #define spin_lock(lock) _spin_lock(loc#ifdef CONFIG_DEBUG_LOCK_ALLOC # define spin_lock_nested (lock, subclass) _spin_lock_nested(lock, subclass) +# define spin_lock_irqsave_nested (lock, flags, subclass) flags = _spin_lock_irqsave_nested(lock, flags, subclass)#else # define spin_lock_nested (lock, subclass) _spin_lock(lock) +# define spin_lock_irqsave_nested (lock, flags, subclass) flags = _spin_lock_irqsave(lock)#endif #define write_lock (lock) _write_lock(lock)
include/linux/spinlock_api_smp.h +2 -0
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) __acquires(lock); +unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) + __acquires(lock); unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) __acquires(lock);unsigned long __lockfunc _write_lock_irqsave (rwlock_t *lock)
include/linux/spinlock_api_up.h +1 -0
@@ -59,6 +59,7 @@ #define _spin_lock_irq(lock) __LOCK_IR#define _read_lock_irq (lock) __LOCK_IRQ(lock)#define _write_lock_irq (lock) __LOCK_IRQ(lock)#define _spin_lock_irqsave (lock, flags) __LOCK_IRQSAVE(lock, flags) +#define _spin_lock_irqsave_nested (lock, flags, subclass) __LOCK_IRQSAVE(lock, flags)#define _read_lock_irqsave (lock, flags) __LOCK_IRQSAVE(lock, flags)#define _write_lock_irqsave (lock, flags) __LOCK_IRQSAVE(lock, flags)#define _spin_trylock (lock) ({ __LOCK(lock); 1; })