Thread (13 messages) 13 messages, 5 authors, 2014-10-17
STALE4257d

[PATCH] tty: serial: 8250_core: Do not call set_sleep for console port

From: Sudhir Sreedharan <hidden>
Date: 2014-10-09 13:46:12
Also in: linux-serial, lkml
Subsystem: 8250/16?50 (and clone uarts) serial driver, the rest, tty layer and serial drivers · Maintainers: Greg Kroah-Hartman, Linus Torvalds, Jiri Slaby

In ST16650V2 based serial uarts, while initalizing the PM state,
LCR registers are being initialized to 0 in serial8250_set_sleep().
If console port is already initialized and being used, this will
throws garbage in the console.

Signed-off-by: Sudhir Sreedharan <redacted>
---
 drivers/tty/serial/8250/8250_core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index ca5cfdc..994aa25 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2618,6 +2618,9 @@ void serial8250_do_pm(struct uart_port *port, unsigned int state,
 {
 	struct uart_8250_port *p = up_to_u8250p(port);
 
+	if (port->cons && (port->cons->flags & CON_ENABLED) && (state == 0))
+		return;
+
 	serial8250_set_sleep(p, state != 0);
 }
 EXPORT_SYMBOL(serial8250_do_pm);
-- 
1.7.0.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help