The patch titled lock validator: s390 rwsem/semaphore changes has been added to the -mm tree. Its filename is lock-validator-s390-rwsem-semaphore-changes.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: lock validator: s390 rwsem/semaphore changes From: Heiko Carstens <heiko.carstens@xxxxxxxxxx> s390 rwsem/semaphore changes for lock validator. Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Acked-by: Ingo Molnar <mingo@xxxxxxx> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/asm-s390/rwsem.h | 31 +++++++++++++++++++++++++++++-- include/asm-s390/semaphore.h | 3 ++- 2 files changed, 31 insertions(+), 3 deletions(-) diff -puN include/asm-s390/rwsem.h~lock-validator-s390-rwsem-semaphore-changes include/asm-s390/rwsem.h --- 25/include/asm-s390/rwsem.h~lock-validator-s390-rwsem-semaphore-changes Mon Jun 19 15:06:06 2006 +++ 25-akpm/include/asm-s390/rwsem.h Mon Jun 19 15:06:06 2006 @@ -61,6 +61,9 @@ struct rw_semaphore { signed long count; spinlock_t wait_lock; struct list_head wait_list; +#ifdef CONFIG_DEBUG_RWSEM_ALLOC + struct lockdep_map dep_map; +#endif }; #ifndef __s390x__ @@ -80,8 +83,16 @@ struct rw_semaphore { /* * initialisation */ + +#ifdef CONFIG_DEBUG_RWSEM_ALLOC +# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } +#else +# define __RWSEM_DEP_MAP_INIT(lockname) +#endif + #define __RWSEM_INITIALIZER(name) \ -{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) } +{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ + __RWSEM_DEP_MAP_INIT(name) } #define DECLARE_RWSEM(name) \ struct rw_semaphore name = __RWSEM_INITIALIZER(name) @@ -93,6 +104,17 @@ static inline void init_rwsem(struct rw_ INIT_LIST_HEAD(&sem->wait_list); } +extern void __init_rwsem(struct rw_semaphore *sem, const char *name, + struct lockdep_type_key *key); + +#define init_rwsem(sem) \ +do { \ + static struct lockdep_type_key __key; \ + \ + __init_rwsem((sem), #sem, &__key); \ +} while (0) + + /* * lock for reading */ @@ -155,7 +177,7 @@ static inline int __down_read_trylock(st /* * lock for writing */ -static inline void __down_write(struct rw_semaphore *sem) +static inline void __down_write_nested(struct rw_semaphore *sem, int subtype) { signed long old, new, tmp; @@ -181,6 +203,11 @@ static inline void __down_write(struct r rwsem_down_write_failed(sem); } +static inline void __down_write(struct rw_semaphore *sem) +{ + __down_write_nested(sem, 0); +} + /* * trylock for writing -- returns 1 if successful, 0 if contention */ diff -puN include/asm-s390/semaphore.h~lock-validator-s390-rwsem-semaphore-changes include/asm-s390/semaphore.h --- 25/include/asm-s390/semaphore.h~lock-validator-s390-rwsem-semaphore-changes Mon Jun 19 15:06:06 2006 +++ 25-akpm/include/asm-s390/semaphore.h Mon Jun 19 15:06:06 2006 @@ -37,7 +37,8 @@ struct semaphore { static inline void sema_init (struct semaphore *sem, int val) { - *sem = (struct semaphore) __SEMAPHORE_INITIALIZER((*sem),val); + atomic_set(&sem->count, val); + init_waitqueue_head(&sem->wait); } static inline void init_MUTEX (struct semaphore *sem) _ Patches currently in -mm which might be from heiko.carstens@xxxxxxxxxx are git-klibc.patch s390-move-var-declarations-behind-ifdef.patch adjust-handle_irr_event-return-type.patch add-__iowrite64_copy-s390-fix.patch kthread-convert-s390machc-from-kernel_thread.patch lock-validator-s390-stacktrace-interface.patch lock-validator-s390-config_frame_pointer-support.patch lock-validator-s390-rwsem-semaphore-changes.patch lock-validator-early_init_irq_lock_type--console_init.patch lock-validator-s390-irqtrace-support.patch lock-validator-__local_bh_enable-_local_bh_enable.patch lock-validator-s390-use-raw_spinlock-in-mcck-handler.patch lock-validator-add-s390-to-supported-options.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html