]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
kdump pv-on-hvm: introduce "reset_devices" command line option
authorOlaf Hering <olaf@aepfle.de>
Tue, 5 Apr 2011 11:41:39 +0000 (12:41 +0100)
committerOlaf Hering <olaf@aepfle.de>
Tue, 5 Apr 2011 11:41:39 +0000 (12:41 +0100)
    upstream commit 7e96287ddc4f42081e18248b6167041c0908004c

    [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>
Documentation/kernel-parameters.txt
include/linux/init.h
init/main.c

index abb68ef094696e48fb5e574b0bd389b9eac67e3e..d2334417153b76bdde60f5c3be9e7138e4f437e5 100644 (file)
@@ -1392,6 +1392,9 @@ running once the system is up.
 
        reserve=        [KNL,BUGS] Force the kernel to ignore some iomem area
 
+       reset_devices   [KNL] Force drivers to reset the underlying device
+                       during initialization.
+
        resume=         [SWSUSP]
                        Specify the partition device for software suspend
 
index 6667785dd1ff22d7452b716b380e7475158ee8b9..e92b1455d7afd8c908bfc0722be018a09c46c226 100644 (file)
@@ -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 **);
index 8651a720a092c4ade7e530c01b57b040c3e52539..7911074a6b45d7c62d7f333aebb26b725f9dd968 100644 (file)
@@ -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;