aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-09-28 13:23:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-28 13:23:44 -0400
commitd5767c53535ac79758084773418e0ad186aba4a2 (patch)
tree75ae8b298213a276ee2d37deaee6d316efc9200c /init
parent2ef7b45a5925c54d948f858e42babb0533b9a3c5 (diff)
bootup: move 'usermodehelper_enable()' to the end of do_basic_setup()
Doing it just before starting to call into cpu_idle() made a sick kind of sense only because the original bug we fixed (see commit 288d5abec831: "Boot up with usermodehelper disabled") was about problems with some scheduler data structures not being initialized, and they had better be initialized at that point. But it really didn't make any other conceptual sense, and doing it after the initial "schedule()" call for the idle thread actually opened up a race: what if the main initialization thread did everything without needing to sleep, and got all the way into user land too? Without actually having scheduled back to the idle thread? Now, in normal circumstances that doesn't ever happen, but it looks like Richard Cochran triggered exactly that on his ARM IXP4xx machines: "I have some ARM IXP4xx based machines that use the two on chip MAC ports (aka NPEs). The NPE needs a firmware in order to function. Ever since the following commit [that 288d5abec831 one], it is no longer possible to bring up the interfaces during the init scripts." with a call trace showing an ioctl coming from user space. Richard says: "The init is busybox, and the startup script does mount, syslogd, and then ifup, so that all can go by quickly." The fix is to move the usermodehelper_enable() into the main 'init' thread, and just put it after we've done all our initcalls. By then, everything really should be up, but we've obviously not actually started the user-mode portion of init yet. Reported-and-tested-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/init/main.c b/init/main.c
index 2a9b88aa5e76..23702bbdbc1d 100644
--- a/init/main.c
+++ b/init/main.c
@@ -381,9 +381,6 @@ static noinline void __init_refok rest_init(void)
381 preempt_enable_no_resched(); 381 preempt_enable_no_resched();
382 schedule(); 382 schedule();
383 383
384 /* At this point, we can enable user mode helper functionality */
385 usermodehelper_enable();
386
387 /* Call into cpu_idle with preempt disabled */ 384 /* Call into cpu_idle with preempt disabled */
388 preempt_disable(); 385 preempt_disable();
389 cpu_idle(); 386 cpu_idle();
@@ -734,6 +731,7 @@ static void __init do_basic_setup(void)
734 init_irq_proc(); 731 init_irq_proc();
735 do_ctors(); 732 do_ctors();
736 do_initcalls(); 733 do_initcalls();
734 usermodehelper_enable();
737} 735}
738 736
739static void __init do_pre_smp_initcalls(void) 737static void __init do_pre_smp_initcalls(void)