aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2009-12-10 06:07:02 -0500
committerMichal Simek <monstr@monstr.eu>2009-12-14 02:40:09 -0500
commitbf2d809668907c69b554459764b36584e4d57e4a (patch)
tree8f3e16925a34645ffd14e6d171937b37a06fba41
parent519e9f417388ba055b7604db5f4f492f7c84f427 (diff)
microblaze: Lockdep support
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>
-rw-r--r--arch/microblaze/Kconfig3
-rw-r--r--arch/microblaze/include/asm/system.h2
-rw-r--r--arch/microblaze/kernel/setup.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 8e1c4f7d3e6e..5ba4dcd56cad 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -60,6 +60,9 @@ config GENERIC_CSUM
60config STACKTRACE_SUPPORT 60config STACKTRACE_SUPPORT
61 def_bool y 61 def_bool y
62 62
63config LOCKDEP_SUPPORT
64 def_bool y
65
63config PCI 66config PCI
64 def_bool n 67 def_bool n
65 68
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index b1ed61590660..157970688b2a 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -16,6 +16,8 @@
16#include <asm-generic/cmpxchg.h> 16#include <asm-generic/cmpxchg.h>
17#include <asm-generic/cmpxchg-local.h> 17#include <asm-generic/cmpxchg-local.h>
18 18
19#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
20
19struct task_struct; 21struct task_struct;
20struct thread_info; 22struct thread_info;
21 23
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 367ad330148e..acd70fe30a71 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -131,6 +131,8 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
131 strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE); 131 strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
132#endif 132#endif
133 133
134 lockdep_init();
135
134/* initialize device tree for usage in early_printk */ 136/* initialize device tree for usage in early_printk */
135 early_init_devtree((void *)_fdt_start); 137 early_init_devtree((void *)_fdt_start);
136 138