diff options
Diffstat (limited to 'init/main.c')
-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. */ |