diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-20 06:06:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-20 07:32:33 -0500 |
commit | 2ce802f62ba32a7d95748ac92bf351f76affb6ff (patch) | |
tree | 54dd0d6063ca61619e6b8ca84dd95b8e5a3c1402 /init | |
parent | 12fcdba1b7ae8b25696433f420b775aeb556d89b (diff) |
lockdep: Move early boot local IRQ enable/disable status to init/main.c
During early boot, local IRQ is disabled until IRQ subsystem is
properly initialized. During this time, no one should enable
local IRQ and some operations which usually are not allowed with
IRQ disabled, e.g. operations which might sleep or require
communications with other processors, are allowed.
lockdep tracked this with early_boot_irqs_off/on() callbacks.
As other subsystems need this information too, move it to
init/main.c and make it generally available. While at it,
toggle the boolean to early_boot_irqs_disabled instead of
enabled so that it can be initialized with %false and %true
indicates the exceptional condition.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110120110635.GB6036@htj.dyndns.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index 00799c1d4628..33c37c379e96 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -96,6 +96,15 @@ static inline void mark_rodata_ro(void) { } | |||
96 | extern void tc_init(void); | 96 | extern void tc_init(void); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | /* | ||
100 | * Debug helper: via this flag we know that we are in 'early bootup code' | ||
101 | * where only the boot processor is running with IRQ disabled. This means | ||
102 | * two things - IRQ must not be enabled before the flag is cleared and some | ||
103 | * operations which are not allowed with IRQ disabled are allowed while the | ||
104 | * flag is set. | ||
105 | */ | ||
106 | bool early_boot_irqs_disabled __read_mostly; | ||
107 | |||
99 | enum system_states system_state __read_mostly; | 108 | enum system_states system_state __read_mostly; |
100 | EXPORT_SYMBOL(system_state); | 109 | EXPORT_SYMBOL(system_state); |
101 | 110 | ||
@@ -554,7 +563,7 @@ asmlinkage void __init start_kernel(void) | |||
554 | cgroup_init_early(); | 563 | cgroup_init_early(); |
555 | 564 | ||
556 | local_irq_disable(); | 565 | local_irq_disable(); |
557 | early_boot_irqs_off(); | 566 | early_boot_irqs_disabled = true; |
558 | 567 | ||
559 | /* | 568 | /* |
560 | * Interrupts are still disabled. Do necessary setups, then | 569 | * Interrupts are still disabled. Do necessary setups, then |
@@ -621,7 +630,7 @@ asmlinkage void __init start_kernel(void) | |||
621 | if (!irqs_disabled()) | 630 | if (!irqs_disabled()) |
622 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " | 631 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " |
623 | "enabled early\n"); | 632 | "enabled early\n"); |
624 | early_boot_irqs_on(); | 633 | early_boot_irqs_disabled = false; |
625 | local_irq_enable(); | 634 | local_irq_enable(); |
626 | 635 | ||
627 | /* Interrupts are enabled now so all GFP allocations are safe. */ | 636 | /* Interrupts are enabled now so all GFP allocations are safe. */ |