public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] char drivers: Ram oops kernel configuration parameters
@ 2011-06-23 18:36 Sergiu Iordache
  2011-06-23 18:39 ` Marco Stornelli
  2011-06-23 19:59 ` Valdis.Kletnieks
  0 siblings, 2 replies; 8+ messages in thread
From: Sergiu Iordache @ 2011-06-23 18:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andrew Morton, Samo Pogacnik, Alan Cox, Randy Dunlap,
	Sergiu Iordache, Marco Stornelli, Seiji Aguchi, Ahmed S. Darwish,
	linux-kernel

Ramoops currently has module parameters for setting the configuration
variables (ram start, ram size and dump oopses). This makes it difficult to
configure when the module is compiled as a builtin.

This patch adds the following 3 configuration options which set the same
variables as the module parameters:
 1. RAMOOPS_RAM_START
 2. RAMOOPS_RAM_SIZE
 3. RAMOOPS_RAM_DUMP_OOPS

Module parameters take precedence over configuration parameters.

Signed-off-by: Sergiu Iordache <sergiu@chromium.org>
---
 drivers/char/Kconfig   |   36 ++++++++++++++++++++++++++++++++++++
 drivers/char/ramoops.c |    6 +++---
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 49502bc..0284f9f 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -608,6 +608,42 @@ config RAMOOPS
 	  This enables panic and oops messages to be logged to a circular
 	  buffer in RAM where it can be read back at some later point.
 
+config RAMOOPS_RAM_START
+	hex "Ramoops physical start address"
+	depends on RAMOOPS
+	default "0"
+	---help---
+	  Start address of the memory area that is used by Ramoops.
+
+	  For this feature to be useful, the selected memory area must be
+ 	  preserved across reboot, so not used by the boot loader, for example.
+
+	  Module parameter takes precedence over this.
+
+config RAMOOPS_RAM_SIZE
+	hex "Ramoops used RAM size"
+	depends on RAMOOPS
+	default "0"
+	---help---
+	  Size of the memory area that is used by Ramoops.
+
+	  For this feature to be useful, the selected memory area must be
+ 	  preserved across reboot, so not used by the boot loader, for example.
+
+	  Module parameter takes precedence over this.
+
+config RAMOOPS_DUMP_OOPS
+	int "Dump oopses or only panics"
+	depends on RAMOOPS
+	default "1"
+	help
+	  Flag to determine what gets dumped to RAM.
+
+	  If set to 1 then both oopses and panics are dumped to RAM.
+	  If set to 0 only kernel panics get dumped to RAM.
+
+	  Module parameter takes precedence over this.
+
 config MSM_SMD_PKT
 	bool "Enable device interface for some SMD packet ports"
 	default n
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c
index 1a9f5f6..31b2c30 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -32,17 +32,17 @@
 
 #define RECORD_SIZE 4096UL
 
-static ulong mem_address;
+static ulong mem_address = CONFIG_RAMOOPS_RAM_START;
 module_param(mem_address, ulong, 0400);
 MODULE_PARM_DESC(mem_address,
 		"start of reserved RAM used to store oops/panic logs");
 
-static ulong mem_size;
+static ulong mem_size = CONFIG_RAMOOPS_RAM_SIZE;
 module_param(mem_size, ulong, 0400);
 MODULE_PARM_DESC(mem_size,
 		"size of reserved RAM used to store oops/panic logs");
 
-static int dump_oops = 1;
+static int dump_oops = CONFIG_RAMOOPS_DUMP_OOPS;
 module_param(dump_oops, int, 0600);
 MODULE_PARM_DESC(dump_oops,
 		"set to 1 to dump oopses, 0 to only dump panics (default 1)");
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-24 17:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 18:36 [PATCH] char drivers: Ram oops kernel configuration parameters Sergiu Iordache
2011-06-23 18:39 ` Marco Stornelli
2011-06-23 19:59 ` Valdis.Kletnieks
2011-06-23 20:43   ` Sergiu Iordache
2011-06-23 21:33     ` Greg KH
2011-06-23 22:07       ` Mandeep Singh Baines
2011-06-24 10:49         ` Marco Stornelli
2011-06-24 17:06           ` Mandeep Singh Baines

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox