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

Shrirang Bagul shrirang.bagul at canonical.com
Fri Feb 21 06:41:19 UTC 2020


From: Johan Hovold <johan at kernel.org>

BugLink: https://bugs.launchpad.net/bugs/1864147

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.

linux-oem buglink: http://bugs.launchpad.net/bugs/1769610

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>
Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
(cherry picked from commit b941b9ada7dc579374f94f8eaad68cb3d95c13d0)
(source tag: Ubuntu-oem-4.15.0-1073.83)
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);
-- 
2.17.1




More information about the kernel-team mailing list