linux/drivers/tty
Dirkjan Bussink 4d9b109060 tty: Prevent deadlock in n_gsm driver
This change fixes a deadlock when the multiplexer is closed while there
are still client side ports open.

When the multiplexer is closed and there are active tty's it tries to
close them with tty_vhangup. This has a problem though, because
tty_vhangup needs the tty_lock. This patch changes it to unlock the
tty_lock before attempting the hangup and relocks afterwards. The
additional call to tty_port_tty_set is needed because otherwise the
port stays active because of the reference counter.

This change also exposed another problem that other code paths don't
expect that the multiplexer could have been closed. This patch also adds
checks for these cases in the gsmtty_ class of function that could be
called.

The documentation explicitly states that "first close all virtual ports
before closing the physical port" but we've found this to not always
reality in our field situations. The GPRS / UTMS modem sometimes crashes
and needs a power cycle in that case which means cleanly shutting down
everything is not always possible. This change makes it much more robust
for our situation where at least the system is recoverable with this patch
and doesn't hang in a deadlock situation inside the kernel.

The patch is against the long term support kernel (3.4.27) and should
apply cleanly to more recent branches. Tested with a Telit GE864-QUADV2
and Telit HE910 modem.

Signed-off-by: Dirkjan Bussink <dirkjan.bussink@nedap.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-30 12:10:09 +01:00
..
hvc tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
ipwireless TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
serial serial: ralink: adds support for the serial core found on ralink wisoc 2013-01-30 00:15:34 -05:00
vt TTY: switch tty_schedule_flip 2013-01-15 22:43:15 -08:00
amiserial.c TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
bfin_jtag_comm.c TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
cyclades.c cyclades: push down tty_port_tty_get 2013-01-15 22:43:15 -08:00
ehv_bytechan.c TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
goldfish.c goldfish: move to tty_port for flip buffers 2013-01-25 08:09:38 -08:00
isicom.c TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
Kconfig goldfish: tty driver 2013-01-21 15:30:08 -08:00
Makefile goldfish: tty driver 2013-01-21 15:30:08 -08:00
moxa.c TTY: switch tty_schedule_flip 2013-01-15 22:43:15 -08:00
moxa.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
mxser.c TTY: switch tty_flip_buffer_push 2013-01-15 22:30:15 -08:00
mxser.h Fix common misspellings 2011-03-31 11:26:23 -03:00
n_gsm.c tty: Prevent deadlock in n_gsm driver 2013-01-30 12:10:09 +01:00
n_hdlc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
n_r3964.c tty: localise the lock 2012-08-10 12:55:47 -07:00
n_tracerouter.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.h n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tty.c Revert "n_tty: Unthrottle tty when flushing read buffer" 2013-01-29 23:35:35 -05:00
nozomi.c TTY: nozomi, remove dead code 2013-01-15 22:43:16 -08:00
pty.c Merge 3.8-rc5 into tty-next 2013-01-25 13:27:36 -08:00
rocket_int.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
rocket.c tty: rocket: Explicitly list supported PCI IDs 2013-01-17 17:28:39 -08:00
rocket.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclink_gt.c TTY: synclink: Convert + to | for bit operations 2013-01-30 00:09:58 -05:00
synclink.c TTY: synclink: Convert + to | for bit operations 2013-01-30 00:09:58 -05:00
synclinkmp.c TTY: synclink: Convert + to | for bit operations 2013-01-30 00:09:58 -05:00
sysrq.c mm, oom: ensure sysrq+f always passes valid zonelist 2012-11-15 17:13:48 -08:00
tty_audit.c TTY: audit, stop accessing tty->icount 2012-10-22 16:50:54 -07:00
tty_buffer.c tty: Correct tty buffer flush. 2013-01-20 15:50:36 -08:00
tty_io.c tty: Fix comments that reference BKL, eventd, old paths 2013-01-15 21:57:44 -08:00
tty_ioctl.c tty: Add driver unthrottle in ioctl(...,TCFLSH,..). 2013-01-18 16:07:34 -08:00
tty_ldisc.c tty: don't deadlock while flushing workqueue 2013-01-15 23:07:15 -08:00
tty_mutex.c tty: tty_mutex.c: Fixed coding style warning (using printk) 2012-10-24 11:34:51 -07:00
tty_port.c TTY: introduce tty_port_destroy 2012-11-15 17:20:58 -08:00