]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
microblaze: Lockdep support
authorMichal Simek <monstr@monstr.eu>
Thu, 10 Dec 2009 11:07:02 +0000 (12:07 +0100)
committerMichal Simek <monstr@monstr.eu>
Mon, 14 Dec 2009 07:40:09 +0000 (08:40 +0100)
Microblaze needs to do lock_init very soon because MMU init calls lock functions.

Here is the explanation from Peter Zijlstra why we have to enable
__ARCH_WANTS_INTERRUPTS_ON_CTSW.

"So we schedule while holding rq->lock (for obvious reasons), but since
lockdep tracks held locks per tasks, we need to transfer the held state
from the prev to the next task. We do this by explicity calling
spin_release(&rq->lock) in context_switch() right before switch_to(),
and calling spin_acquire(&rq->lock) in
finish_task_switch()->finish_lock_switch().

Now, for some reason lockdep thinks that interrupts got enabled over the
context switch (git grep __ARCH_WANTS_INTERRUPTS_ON_CTSW arch/microblaze
doesn't seem to turn up anything).

Clearly trying to acquire the rq->lock with interrupts enabled is a bad
idea and lockdep warns you about this."

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/Kconfig
arch/microblaze/include/asm/system.h
arch/microblaze/kernel/setup.c

index 8e1c4f7d3e6ec45e201c1ad74d123b1c0a6e8516..5ba4dcd56cadf1777d9df3356842ae6688865c38 100644 (file)
@@ -60,6 +60,9 @@ config GENERIC_CSUM
 config STACKTRACE_SUPPORT
        def_bool y
 
+config LOCKDEP_SUPPORT
+       def_bool y
+
 config PCI
        def_bool n
 
index b1ed6159066006bd3d635f57126316a12f25962a..157970688b2aba72037e94b4e08a96fc831184ac 100644 (file)
@@ -16,6 +16,8 @@
 #include <asm-generic/cmpxchg.h>
 #include <asm-generic/cmpxchg-local.h>
 
+#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
+
 struct task_struct;
 struct thread_info;
 
index 367ad330148e3388cb2678be2f2a984d983501ff..acd70fe30a7102efd35f8ac73191a0e0ecacee0e 100644 (file)
@@ -131,6 +131,8 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
                strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
 #endif
 
+       lockdep_init();
+
 /* initialize device tree for usage in early_printk */
        early_init_devtree((void *)_fdt_start);