summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2006-09-27 01:50:44 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 08:26:17 -0700
commit7e96287ddc4f42081e18248b6167041c0908004c (patch)
tree6c890798c6c7093c74e3c44324d29ae99fade24f /init
parentbcdc5e019d9f525a9f181a7de642d3a9c27c7610 (diff)
[PATCH] kdump: introduce "reset_devices" command line option
Resetting the devices during driver initialization can be a costly operation in terms of time (especially scsi devices). This option can be used by drivers to know that user forcibly wants the devices to be reset during initialization. This option can be useful while kernel is booting in unreliable environment. For ex. during kdump boot where devices are in unknown random state and BIOS execution has been skipped. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init')
-rw-r--r--init/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index 913e48d658e..0766e69712b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -128,6 +128,18 @@ static char *ramdisk_execute_command;
static unsigned int max_cpus = NR_CPUS;
/*
+ * If set, this is an indication to the drivers that reset the underlying
+ * device before going ahead with the initialization otherwise driver might
+ * rely on the BIOS and skip the reset operation.
+ *
+ * This is useful if kernel is booting in an unreliable environment.
+ * For ex. kdump situaiton where previous kernel has crashed, BIOS has been
+ * skipped and devices will be in unknown state.
+ */
+unsigned int reset_devices;
+EXPORT_SYMBOL(reset_devices);
+
+/*
* Setup routine for controlling SMP activation
*
* Command-line option of "nosmp" or "maxcpus=0" will disable SMP
@@ -153,6 +165,14 @@ static int __init maxcpus(char *str)
__setup("maxcpus=", maxcpus);
+static int __init set_reset_devices(char *str)
+{
+ reset_devices = 1;
+ return 1;
+}
+
+__setup("reset_devices", set_reset_devices);
+
static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
static const char *panic_later, *panic_param;