Subject: commit a802dd0e breaks console keyboard input
Date: Sat, 25 Oct 2008 16:16:22 +0200
From: Heiko Carstens <heiko.carstens@de.ibm.com>

The patch below moves the init_workqueues() call to its old place but
makes the stop_machine initialization happen later (but still before
core_initcalls).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/stop_machine.h |    6 ++++++
 init/main.c                  |    5 +++--
 kernel/stop_machine.c        |    4 +---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff -r 2b5f764088ee include/linux/stop_machine.h
--- a/include/linux/stop_machine.h	Sun Oct 26 18:50:23 2008 +1100
+++ b/include/linux/stop_machine.h	Sun Oct 26 19:13:04 2008 +1100
@@ -35,6 +35,9 @@ int stop_machine(int (*fn)(void *), void
  * won't come or go while it's being called.  Used by hotplug cpu.
  */
 int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus);
+
+void stop_machine_init(void);
+
 #else
 
 static inline int stop_machine(int (*fn)(void *), void *data,
@@ -46,5 +49,8 @@ static inline int stop_machine(int (*fn)
 	local_irq_enable();
 	return ret;
 }
+
+static inline void stop_machine_init(void) { }
+
 #endif /* CONFIG_SMP */
 #endif /* _LINUX_STOP_MACHINE */
diff -r 2b5f764088ee init/main.c
--- a/init/main.c	Sun Oct 26 18:50:23 2008 +1100
+++ b/init/main.c	Sun Oct 26 19:13:04 2008 +1100
@@ -38,6 +38,7 @@
 #include <linux/moduleparam.h>
 #include <linux/kallsyms.h>
 #include <linux/writeback.h>
+#include <linux/stop_machine.h>
 #include <linux/cpu.h>
 #include <linux/cpuset.h>
 #include <linux/cgroup.h>
@@ -767,6 +768,8 @@ static void __init do_basic_setup(void)
 static void __init do_basic_setup(void)
 {
 	rcu_init_sched(); /* needed by module_init stage. */
+	init_workqueues();
+	stop_machine_init();
 	usermodehelper_init();
 	driver_init();
 	init_irq_proc();
@@ -850,8 +853,6 @@ static int __init kernel_init(void * unu
 
 	cad_pid = task_pid(current);
 
-	init_workqueues();
-
 	smp_prepare_cpus(setup_max_cpus);
 
 	do_pre_smp_initcalls();
diff -r 2b5f764088ee kernel/stop_machine.c
--- a/kernel/stop_machine.c	Sun Oct 26 18:50:23 2008 +1100
+++ b/kernel/stop_machine.c	Sun Oct 26 19:13:04 2008 +1100
@@ -154,10 +154,8 @@ int stop_machine(int (*fn)(void *), void
 }
 EXPORT_SYMBOL_GPL(stop_machine);
 
-static int __init stop_machine_init(void)
+void __init stop_machine_init(void)
 {
 	stop_machine_wq = create_rt_workqueue("kstop");
 	stop_machine_work = alloc_percpu(struct work_struct);
-	return 0;
 }
-early_initcall(stop_machine_init);
