Skip to content

Commit

Permalink
serial: fix serial_txx9 console initialization
Browse files Browse the repository at this point in the history
Since commit 97d9722 ("[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>
  • Loading branch information
Atsushi Nemoto authored and Linus Torvalds committed Oct 30, 2007
1 parent 10e27ed commit 23f42b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/serial/serial_txx9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 23f42b7

Please sign in to comment.