[PATCH] Late console

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

due my job on sleep I need the serial console till sleep time so let
me propose this patch that disables serial port suspend if a console
is running on it and the kernel has CONFIG_DEBUG_KERNEL flag on.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@xxxxxxxxxxxx
Linux Device Driver                             giometti@xxxxxxxxx
Embedded Systems                     		giometti@xxxxxxxx
UNIX programming                     phone:     +39 349 2432127
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 9e27aee..27ed4f2 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1919,6 +1919,14 @@ int uart_suspend_port(struct uart_driver
 {
 	struct uart_state *state = drv->state + port->line;
 
+#ifdef CONFIG_DEBUG_KERNEL
+	if (uart_console(port)) {
+		printk(KERN_INFO "warning! Serial console %s%d is not disabled in debug kernel mode\n",
+			drv->dev_name, port->line);
+		return 0;
+	}
+#endif
+
 	mutex_lock(&state->mutex);
 
 	if (state->info && state->info->flags & UIF_INITIALIZED) {

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux