Leave serial console active during freeze and prethaw, so we don't discard the most interesting diagnostics. Note that wakeup-enabled serial ports may already be bypassing the suspend logic on some platforms, for serial ports which are enabled as wakeup event sources. Index: linux/drivers/serial/8250.c =================================================================== --- linux.orig/drivers/serial/8250.c 2006-05-20 11:28:30.000000000 -0700 +++ linux/drivers/serial/8250.c 2006-05-20 11:29:51.000000000 -0700 @@ -2455,13 +2455,37 @@ return 0; } +/* HACK -- skipconsoles known to work with single serial port, + * allowing serial port to work during freeze/prethaw/thaw + * ... really the flag should be per-port + */ +static int skipconsoles; + +/* uart_console() should be in a header ... */ +#ifdef CONFIG_SERIAL_CORE_CONSOLE +#define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line) +#else +#define uart_console(port) (0) +#endif + static int serial8250_suspend(struct platform_device *dev, pm_message_t state) { int i; - for (i = 0; i < UART_NR; i++) { + for (i = 0; + 0 && + i < UART_NR; i++) { struct uart_8250_port *up = &serial8250_ports[i]; + switch (state.event) { + case PM_EVENT_FREEZE: + case PM_EVENT_PRETHAW: + if (uart_console(&up->port)) { + skipconsoles = 1; + continue; + } + } + if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) uart_suspend_port(&serial8250_reg, &up->port); } @@ -2473,9 +2497,16 @@ { int i; - for (i = 0; i < UART_NR; i++) { + for (i = 0; + 0 && + i < UART_NR; i++) { struct uart_8250_port *up = &serial8250_ports[i]; + if (skipconsoles && uart_console(&up->port)) { + skipconsoles = 0; + continue; + } + if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) uart_resume_port(&serial8250_reg, &up->port); }