WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] kdump: introduce "reset_devices" command line option

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] kdump: introduce "reset_devices" command line option
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 4 Feb 2011 16:28:50 +0100
Delivery-date: Fri, 04 Feb 2011 07:30:27 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1296833336; l=2956; s=domk; d=aepfle.de; h=Content-Type:MIME-Version:Subject:To:From:Date:X-RZG-CLASS-ID: X-RZG-AUTH; bh=Mz9DbW7/SAtFUupgbEr/JzICgMM=; b=kG7nAk9MIs68aSnvQXaAe/vgCbIke2tUNpm47KdFkUwkcWfXFRuxCq+4s9qXLNMURWl Zm3R4EGUtnf9/GR8daablSO3GdgLYTvK0oxxGP/q6JC6TYW2BwlwI3AKhnm4snycriCsr 0382oQ5kKAkhp8J5DhwPSJAR/lvBy3EmW3o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
upstream commit 7e96287ddc4f42081e18248b6167041c0908004c
Author: Vivek Goyal <vgoyal@xxxxxxxxxx>

    [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@xxxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxx>

---

This change from 2.6.19-rc1 is required for the following kdump patch.

 Documentation/kernel-parameters.txt |    3 +++
 include/linux/init.h                |    1 +
 init/main.c                         |   20 ++++++++++++++++++++
 3 files changed, 24 insertions(+)

--- linux-2.6.18-xen.hg.orig/Documentation/kernel-parameters.txt
+++ linux-2.6.18-xen.hg/Documentation/kernel-parameters.txt
@@ -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
 
--- linux-2.6.18-xen.hg.orig/include/linux/init.h
+++ linux-2.6.18-xen.hg/include/linux/init.h
@@ -68,6 +68,7 @@ extern initcall_t __security_initcall_st
 
 /* 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 **);
--- linux-2.6.18-xen.hg.orig/init/main.c
+++ linux-2.6.18-xen.hg/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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>