TTY: fix DTR not being dropped on hang up
authorJohan Hovold <jhovold@gmail.com>
Thu, 7 Mar 2013 14:55:51 +0000 (15:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2013 23:27:53 +0000 (16:27 -0700)
commit957dacaee56d18e5c2cbe722429de5a746a3cf44
treed3043274b963ecf5c127bc6b77c94662ef056fd6
parente584a02cf517537a3d13c7f85ced45fd07ab85cd
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>
drivers/tty/mxser.c
drivers/tty/n_gsm.c
drivers/tty/tty_port.c