Răsfoiți Sursa

serdev: ttyport: ignore carrier detect to avoid hangups

Serdev currently does not support hangups so make sure to set CLOCAL to
prevent loss of carrier from triggering one.

Note however that not all tty drivers honour CLOCAL.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold 7 ani în urmă
părinte
comite
cda64188ca
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      drivers/tty/serdev/serdev-ttyport.c

+ 2 - 0
drivers/tty/serdev/serdev-ttyport.c

@@ -115,6 +115,8 @@ static int ttyport_open(struct serdev_controller *ctrl)
 	ktermios.c_cflag &= ~(CSIZE | PARENB);
 	ktermios.c_cflag |= CS8;
 	ktermios.c_cflag |= CRTSCTS;
+	/* Hangups are not supported so make sure to ignore carrier detect. */
+	ktermios.c_cflag |= CLOCAL;
 	tty_set_termios(tty, &ktermios);
 
 	set_bit(SERPORT_ACTIVE, &serport->flags);