]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
serial: fix serial_txx9 console initialization
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Mon, 29 Oct 2007 21:37:23 +0000 (14:37 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 30 Oct 2007 15:06:55 +0000 (08:06 -0700)
Since commit 97d97224ff361e08777fb33e0fd193ca877dac28 ("[SERIAL] Fix
console initialisation ordering"), serial_core calls ->pm() on
initialization even if the port was used for console.

This behaviour breaks serial_txx9 console since The serial_txx9 driver
initialize its port entirely on its ->pm() method if new state was 0.
This patch adds checking for oldstate value to fix this probelm.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/serial_txx9.c

index 6846a6c38b6d5535784bafd4884a51bbbc2e5be4..7ad21925869a0550465b56bac0e5a7c771f2fb31 100644 (file)
@@ -657,7 +657,15 @@ static void
 serial_txx9_pm(struct uart_port *port, unsigned int state,
              unsigned int oldstate)
 {
-       if (state == 0)
+       /*
+        * If oldstate was -1 this is called from
+        * uart_configure_port().  In this case do not initialize the
+        * port now, because the port was already initialized (for
+        * non-console port) or should not be initialized here (for
+        * console port).  If we initialized the port here we lose
+        * serial console settings.
+        */
+       if (state == 0 && oldstate != -1)
                serial_txx9_initialize(port);
 }