Skip to content

Commit

Permalink
[PATCH] suspend: make it possible to disable serial console suspend
Browse files Browse the repository at this point in the history
Hack uart_suspend_port() and uart_resume_port() so that serial console
ports are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set.

This makes it possible to debug the suspend and resume routines of all
device drivers as well as the lowest-level swsusp code with the help of the
serial console.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Sep 26, 2006
1 parent c8eb8b4 commit e1da95a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,13 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)

mutex_lock(&state->mutex);

#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
if (uart_console(port)) {
mutex_unlock(&state->mutex);
return 0;
}
#endif

if (state->info && state->info->flags & UIF_INITIALIZED) {
const struct uart_ops *ops = port->ops;

Expand Down Expand Up @@ -1967,6 +1974,13 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)

mutex_lock(&state->mutex);

#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
if (uart_console(port)) {
mutex_unlock(&state->mutex);
return 0;
}
#endif

uart_change_pm(state, 0);

/*
Expand Down

0 comments on commit e1da95a

Please sign in to comment.