Browse Source

serial: kgdb_nmi: No CON_ENABLED by default

At present this console is optionally registered by NULL checking
arch_kgdb_ops.enable_nmi. In practice this requires the architecture
dependant code to implement some kind of control (e.g. module arguments)
to enable/disable this feature.

The kernel already provides us the perfectly adequate console= argument
to enable/disable consoles. Let's use that instead!

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Thompson 11 years ago
parent
commit
287f03c0d4
1 changed files with 3 additions and 2 deletions
  1. 3 2
      drivers/tty/serial/kgdb_nmi.c

+ 3 - 2
drivers/tty/serial/kgdb_nmi.c

@@ -46,6 +46,8 @@ static atomic_t kgdb_nmi_num_readers = ATOMIC_INIT(0);
 
 
 static int kgdb_nmi_console_setup(struct console *co, char *options)
 static int kgdb_nmi_console_setup(struct console *co, char *options)
 {
 {
+	arch_kgdb_ops.enable_nmi(1);
+
 	/* The NMI console uses the dbg_io_ops to issue console messages. To
 	/* The NMI console uses the dbg_io_ops to issue console messages. To
 	 * avoid duplicate messages during kdb sessions we must inform kdb's
 	 * avoid duplicate messages during kdb sessions we must inform kdb's
 	 * I/O utilities that messages sent to the console will automatically
 	 * I/O utilities that messages sent to the console will automatically
@@ -77,7 +79,7 @@ static struct console kgdb_nmi_console = {
 	.setup  = kgdb_nmi_console_setup,
 	.setup  = kgdb_nmi_console_setup,
 	.write	= kgdb_nmi_console_write,
 	.write	= kgdb_nmi_console_write,
 	.device	= kgdb_nmi_console_device,
 	.device	= kgdb_nmi_console_device,
-	.flags	= CON_PRINTBUFFER | CON_ANYTIME | CON_ENABLED,
+	.flags	= CON_PRINTBUFFER | CON_ANYTIME,
 	.index	= -1,
 	.index	= -1,
 };
 };
 
 
@@ -354,7 +356,6 @@ int kgdb_register_nmi_console(void)
 	}
 	}
 
 
 	register_console(&kgdb_nmi_console);
 	register_console(&kgdb_nmi_console);
-	arch_kgdb_ops.enable_nmi(1);
 
 
 	return 0;
 	return 0;
 err_drv_reg:
 err_drv_reg: