diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-09-27 04:50:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:17 -0400 |
commit | 7e96287ddc4f42081e18248b6167041c0908004c (patch) | |
tree | 6c890798c6c7093c74e3c44324d29ae99fade24f | |
parent | bcdc5e019d9f525a9f181a7de642d3a9c27c7610 (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>
-rw-r--r-- | Documentation/kernel-parameters.txt | 3 | ||||
-rw-r--r-- | include/linux/init.h | 1 | ||||
-rw-r--r-- | init/main.c | 20 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 255ec535bba8..54983246930d 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1370,6 +1370,9 @@ running once the system is up. | |||
1370 | Reserves a hole at the top of the kernel virtual | 1370 | Reserves a hole at the top of the kernel virtual |
1371 | address space. | 1371 | address space. |
1372 | 1372 | ||
1373 | reset_devices [KNL] Force drivers to reset the underlying device | ||
1374 | during initialization. | ||
1375 | |||
1373 | resume= [SWSUSP] | 1376 | resume= [SWSUSP] |
1374 | Specify the partition device for software suspend | 1377 | Specify the partition device for software suspend |
1375 | 1378 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index 6667785dd1ff..e92b1455d7af 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -68,6 +68,7 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[]; | |||
68 | 68 | ||
69 | /* Defined in init/main.c */ | 69 | /* Defined in init/main.c */ |
70 | extern char saved_command_line[]; | 70 | extern char saved_command_line[]; |
71 | extern unsigned int reset_devices; | ||
71 | 72 | ||
72 | /* used by init/main.c */ | 73 | /* used by init/main.c */ |
73 | extern void setup_arch(char **); | 74 | extern void setup_arch(char **); |
diff --git a/init/main.c b/init/main.c index 913e48d658ee..0766e69712b2 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -128,6 +128,18 @@ static char *ramdisk_execute_command; | |||
128 | static unsigned int max_cpus = NR_CPUS; | 128 | static unsigned int max_cpus = NR_CPUS; |
129 | 129 | ||
130 | /* | 130 | /* |
131 | * If set, this is an indication to the drivers that reset the underlying | ||
132 | * device before going ahead with the initialization otherwise driver might | ||
133 | * rely on the BIOS and skip the reset operation. | ||
134 | * | ||
135 | * This is useful if kernel is booting in an unreliable environment. | ||
136 | * For ex. kdump situaiton where previous kernel has crashed, BIOS has been | ||
137 | * skipped and devices will be in unknown state. | ||
138 | */ | ||
139 | unsigned int reset_devices; | ||
140 | EXPORT_SYMBOL(reset_devices); | ||
141 | |||
142 | /* | ||
131 | * Setup routine for controlling SMP activation | 143 | * Setup routine for controlling SMP activation |
132 | * | 144 | * |
133 | * Command-line option of "nosmp" or "maxcpus=0" will disable SMP | 145 | * Command-line option of "nosmp" or "maxcpus=0" will disable SMP |
@@ -153,6 +165,14 @@ static int __init maxcpus(char *str) | |||
153 | 165 | ||
154 | __setup("maxcpus=", maxcpus); | 166 | __setup("maxcpus=", maxcpus); |
155 | 167 | ||
168 | static int __init set_reset_devices(char *str) | ||
169 | { | ||
170 | reset_devices = 1; | ||
171 | return 1; | ||
172 | } | ||
173 | |||
174 | __setup("reset_devices", set_reset_devices); | ||
175 | |||
156 | static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; | 176 | static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; |
157 | char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; | 177 | char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; |
158 | static const char *panic_later, *panic_param; | 178 | static const char *panic_later, *panic_param; |