From: Johan Hovold Date: Fri, 3 Nov 2017 14:30:58 +0000 (+0100) Subject: serdev: ttyport: ignore carrier detect to avoid hangups X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cda64188ca918fcddc8c6e89bbee5a38b029117a;p=linux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index f76a8e044e4ef..75f312ed96e84 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/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);