aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@debian.org>2007-10-18 06:04:50 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:19 -0400
commit8f4ce8c32f2dc2bc2411cafe39976fc5c0adfabf (patch)
tree04f9009812e13f97b3eaae6385a0bb49cc2312b1 /kernel/printk.c
parent438e2ce68dfd4af4cfcec2f873564fb921db4bb5 (diff)
serial: turn serial console suspend a boot rather than compile time option
Currently, there's a CONFIG_DISABLE_CONSOLE_SUSPEND that allows one to stop the serial console from being suspended when the rest of the machine goes to sleep. This is incredibly useful for debugging power management-related things; however, having it as a compile-time option has proved to be incredibly inconvenient for us (OLPC). There are plenty of times that we want serial console to not suspend, but for the most part we'd like serial console to be suspended. This drops CONFIG_DISABLE_CONSOLE_SUSPEND, and replaces it with a kernel boot parameter (no_console_suspend). By default, the serial console will be suspended along with the rest of the system; by passing 'no_console_suspend' to the kernel during boot, serial console will remain alive during suspend. For now, this is pretty serial console specific; further fixes could be applied to make this work for things like netconsole. Signed-off-by: Andres Salomon <dilinger@debian.org> Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Nigel Cunningham <nigel@suspend2.net> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 52493474f0ab..a30fe33de395 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -862,7 +862,16 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
862 return -1; 862 return -1;
863} 863}
864 864
865#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND 865int console_suspend_enabled = 1;
866EXPORT_SYMBOL(console_suspend_enabled);
867
868static int __init console_suspend_disable(char *str)
869{
870 console_suspend_enabled = 0;
871 return 1;
872}
873__setup("no_console_suspend", console_suspend_disable);
874
866/** 875/**
867 * suspend_console - suspend the console subsystem 876 * suspend_console - suspend the console subsystem
868 * 877 *
@@ -870,6 +879,8 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
870 */ 879 */
871void suspend_console(void) 880void suspend_console(void)
872{ 881{
882 if (!console_suspend_enabled)
883 return;
873 printk("Suspending console(s)\n"); 884 printk("Suspending console(s)\n");
874 acquire_console_sem(); 885 acquire_console_sem();
875 console_suspended = 1; 886 console_suspended = 1;
@@ -877,10 +888,11 @@ void suspend_console(void)
877 888
878void resume_console(void) 889void resume_console(void)
879{ 890{
891 if (!console_suspend_enabled)
892 return;
880 console_suspended = 0; 893 console_suspended = 0;
881 release_console_sem(); 894 release_console_sem();
882} 895}
883#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
884 896
885/** 897/**
886 * acquire_console_sem - lock the console system for exclusive use. 898 * acquire_console_sem - lock the console system for exclusive use.