aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_buffer.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-06-15 07:04:48 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 19:38:34 -0400
commit36697529b5bbe36911e39a6309e7a7c9250d280a (patch)
tree5cbffa976994cb798e00d60eccb46c6cafc369a1 /drivers/tty/tty_buffer.c
parentd2c438905f9f718b3d9f5d89ce163fc22bd33995 (diff)
tty: Replace ldisc locking with ldisc_sem
Line discipline locking was performed with a combination of a mutex, a status bit, a count, and a waitqueue -- basically, a rw semaphore. Replace the existing combination with an ld_semaphore. Fixes: 1) the 'reference acquire after ldisc locked' bug 2) the over-complicated halt mechanism 3) lock order wrt. tty_lock() 4) dropping locks while changing ldisc 5) previously unidentified deadlock while locking ldisc from both linked ttys concurrently 6) previously unidentified recursive deadlocks Adds much-needed lockdep diagnostics. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_buffer.c')
-rw-r--r--drivers/tty/tty_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 9121c1f7aeef..a42a028a9d4e 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -429,7 +429,7 @@ static void flush_to_ldisc(struct work_struct *work)
429 return; 429 return;
430 430
431 disc = tty_ldisc_ref(tty); 431 disc = tty_ldisc_ref(tty);
432 if (disc == NULL) /* !TTY_LDISC */ 432 if (disc == NULL)
433 return; 433 return;
434 434
435 spin_lock_irqsave(&buf->lock, flags); 435 spin_lock_irqsave(&buf->lock, flags);