[SRU OEM-B][PATCH 02/10] serdev: ttyport: ignore carrier detect to avoid hangups

Shrirang Bagul shrirang.bagul at canonical.com
Mon May 7 10:56:31 UTC 2018

From: Johan Hovold <johan at kernel.org>

BugLink: http://bugs.launchpad.net/bugs/1769610

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 at kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
(cherry picked from commit cda64188ca918fcddc8c6e89bbee5a38b029117a)
Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
 drivers/tty/serdev/serdev-ttyport.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index f892fbe08208..c2629ab1bbcf 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -133,6 +133,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);

More information about the kernel-team mailing list