--- include/linux/semaphore.h | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-2.6/include/linux/semaphore.h =================================================================== --- linux-2.6.orig/include/linux/semaphore.h +++ linux-2.6/include/linux/semaphore.h @@ -41,7 +41,11 @@ struct semaphore { static inline void sema_init(struct semaphore *sem, int val) { + static struct lock_class_key __key; + *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); + + lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); } #define init_MUTEX(sem) sema_init(sem, 1)