Commit e5f29853 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Linus Torvalds

[PATCH] Enable all events for initramfs

Currently most driver events are not sent out when using initramfs as
driver_init() (which triggers the events) is called before init_workqueues.

This patch rearranges the init calls so that the hotplug event queue is
enabled prior to calling driver_init(), hence we're getting all hotplug
events again.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0a50caad
......@@ -35,6 +35,7 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);
extern void usermodehelper_init(void);
#ifdef CONFIG_HOTPLUG
extern char hotplug_path [];
......
......@@ -31,6 +31,7 @@
#include <linux/tty.h>
#include <linux/gfp.h>
#include <linux/percpu.h>
#include <linux/kmod.h>
#include <linux/kernel_stat.h>
#include <linux/security.h>
#include <linux/workqueue.h>
......@@ -605,6 +606,10 @@ static void __init do_initcalls(void)
*/
static void __init do_basic_setup(void)
{
/* drivers will send hotplug events */
init_workqueues();
usermodehelper_init();
driver_init();
#ifdef CONFIG_SYSCTL
......@@ -614,7 +619,6 @@ static void __init do_basic_setup(void)
/* Networking initialization needs a process context */
sock_init();
init_workqueues();
do_initcalls();
}
......
......@@ -272,10 +272,8 @@ int call_usermodehelper(char *path, char **argv, char **envp, int wait)
}
EXPORT_SYMBOL(call_usermodehelper);
static __init int usermodehelper_init(void)
void __init usermodehelper_init(void)
{
khelper_wq = create_singlethread_workqueue("khelper");
BUG_ON(!khelper_wq);
return 0;
}
core_initcall(usermodehelper_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment