From 916781ad7b63e960ca7f294da3a2b0c3ef9105db Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Wed, 27 Sep 2006 01:50:44 -0700 Subject: [PATCH] --- yaml --- r: 36191 b: refs/heads/master c: 7e96287ddc4f42081e18248b6167041c0908004c h: refs/heads/master i: 36189: a32eb60c6c91a19adabac495eaffb5aae3631e30 36187: cc1c373977b29e0ed03f00472159938000e8f132 36183: d39316ffe5595238287f06d71e4a4791f2243610 36175: 96efe71ff0eefec8b9deac4c2760d1966b25cdef 36159: 4864c295097bf88bf8b5ed061767111781c7c300 v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 3 +++ trunk/include/linux/init.h | 1 + trunk/init/main.c | 20 ++++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7239fc8d240d..617cc38b0237 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bcdc5e019d9f525a9f181a7de642d3a9c27c7610 +refs/heads/master: 7e96287ddc4f42081e18248b6167041c0908004c diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 255ec535bba8..54983246930d 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -1370,6 +1370,9 @@ running once the system is up. Reserves a hole at the top of the kernel virtual address space. + reset_devices [KNL] Force drivers to reset the underlying device + during initialization. + resume= [SWSUSP] Specify the partition device for software suspend diff --git a/trunk/include/linux/init.h b/trunk/include/linux/init.h index 6667785dd1ff..e92b1455d7af 100644 --- a/trunk/include/linux/init.h +++ b/trunk/include/linux/init.h @@ -68,6 +68,7 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[]; /* Defined in init/main.c */ extern char saved_command_line[]; +extern unsigned int reset_devices; /* used by init/main.c */ extern void setup_arch(char **); diff --git a/trunk/init/main.c b/trunk/init/main.c index 913e48d658ee..0766e69712b2 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -127,6 +127,18 @@ static char *ramdisk_execute_command; /* Setup configured maximum number of CPUs to activate */ 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 * @@ -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;