aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
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 /drivers/serial
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 'drivers/serial')
-rw-r--r--drivers/serial/serial_core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 68aa4da01865..103189095c80 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1959,12 +1959,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
1959 1959
1960 mutex_lock(&state->mutex); 1960 mutex_lock(&state->mutex);
1961 1961
1962#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND 1962 if (!console_suspend_enabled && uart_console(port)) {
1963 if (uart_console(port)) { 1963 /* we're going to avoid suspending serial console */
1964 mutex_unlock(&state->mutex); 1964 mutex_unlock(&state->mutex);
1965 return 0; 1965 return 0;
1966 } 1966 }
1967#endif
1968 1967
1969 tty_dev = device_find_child(port->dev, &match, serial_match_port); 1968 tty_dev = device_find_child(port->dev, &match, serial_match_port);
1970 if (device_may_wakeup(tty_dev)) { 1969 if (device_may_wakeup(tty_dev)) {
@@ -2016,12 +2015,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2016 2015
2017 mutex_lock(&state->mutex); 2016 mutex_lock(&state->mutex);
2018 2017
2019#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND 2018 if (!console_suspend_enabled && uart_console(port)) {
2020 if (uart_console(port)) { 2019 /* no need to resume serial console, it wasn't suspended */
2021 mutex_unlock(&state->mutex); 2020 mutex_unlock(&state->mutex);
2022 return 0; 2021 return 0;
2023 } 2022 }
2024#endif
2025 2023
2026 if (!port->suspended) { 2024 if (!port->suspended) {
2027 disable_irq_wake(port->irq); 2025 disable_irq_wake(port->irq);