serdev: ttyport: ignore carrier detect to avoid hangups
authorJohan Hovold <johan@kernel.org>
Fri, 3 Nov 2017 14:30:58 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:03:35 +0000 (16:03 +0100)
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>
drivers/tty/serdev/serdev-ttyport.c

index f76a8e044e4ef3b10e121b56de32726b3856926a..75f312ed96e8493cd986e89386d12d671f526128 100644 (file)
@@ -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);