Skip to content

Commit

Permalink
serial: assert DTR for serial console devices
Browse files Browse the repository at this point in the history
Some RS-232 devices require DTR to be asserted before they can be used.  DTR
is normally asserted in uart_startup() when the port is opened.  But we don't
actually open serial console ports, so assert DTR when the port is added.

BTW:
earlyprintk and early_uart are hard coded to set DTR/RTS.

rmk says

  The only issue I can think of is the possibility for an attached modem to
  auto-answer or maybe even auto-dial before the system is ready for it to do
  so.  Might have an undesirable cost implication for some running with such a
  setup.

  Apart from that, I can't think of any other side effect of this specific
  patch.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Andi Kleen <ak@suse.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Yinghai Lu authored and Linus Torvalds committed Jul 16, 2007
1 parent 23936cc commit 7949268
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,12 @@ uart_set_options(struct uart_port *port, struct console *co,
if (flow == 'r')
termios.c_cflag |= CRTSCTS;

/*
* some uarts on other side don't support no flow control.
* So we set * DTR in host uart to make them happy
*/
port->mctrl |= TIOCM_DTR;

port->ops->set_termios(port, &termios, NULL);
co->cflag = termios.c_cflag;

Expand Down

0 comments on commit 7949268

Please sign in to comment.