aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_gsm.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-03-07 09:55:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-18 19:27:53 -0400
commit957dacaee56d18e5c2cbe722429de5a746a3cf44 (patch)
treed3043274b963ecf5c127bc6b77c94662ef056fd6 /drivers/tty/n_gsm.c
parente584a02cf517537a3d13c7f85ced45fd07ab85cd (diff)
TTY: fix DTR not being dropped on hang up
Move HUPCL handling to port shutdown so that DTR is dropped also on hang up (tty_port_close is a noop for hung-up ports). Also do not try to drop DTR for uninitialised ports where it has never been raised (e.g. after a failed open). Note that this is also the current behaviour of serial-core. Nine drivers currently call tty_port_close_start directly (rather than through tty_port_close) and seven of them lower DTR as part of their close (if the port has been initialised). Fixup the remaining two drivers so that it continues to be lowered also on normal (non-HUP) close. [ Note that most of those other seven drivers did not expect DTR to have been dropped by tty_port_close_start in the first place. ] Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_gsm.c')
-rw-r--r--drivers/tty/n_gsm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 74d9a0258d7c..642239015b46 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2964,6 +2964,10 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
2964 if (tty_port_close_start(&dlci->port, tty, filp) == 0) 2964 if (tty_port_close_start(&dlci->port, tty, filp) == 0)
2965 goto out; 2965 goto out;
2966 gsm_dlci_begin_close(dlci); 2966 gsm_dlci_begin_close(dlci);
2967 if (test_bit(ASYNCB_INITIALIZED, &dlci->port.flags)) {
2968 if (C_HUPCL(tty))
2969 tty_port_lower_dtr_rts(&dlci->port);
2970 }
2967 tty_port_close_end(&dlci->port, tty); 2971 tty_port_close_end(&dlci->port, tty);
2968 tty_port_tty_set(&dlci->port, NULL); 2972 tty_port_tty_set(&dlci->port, NULL);
2969out: 2973out: