diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 07:04:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 19:38:34 -0400 |
commit | 36697529b5bbe36911e39a6309e7a7c9250d280a (patch) | |
tree | 5cbffa976994cb798e00d60eccb46c6cafc369a1 /include/linux/tty_ldisc.h | |
parent | d2c438905f9f718b3d9f5d89ce163fc22bd33995 (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 'include/linux/tty_ldisc.h')
-rw-r--r-- | include/linux/tty_ldisc.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index a1b048999821..23bdd9debb84 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -203,8 +203,7 @@ struct tty_ldisc_ops { | |||
203 | 203 | ||
204 | struct tty_ldisc { | 204 | struct tty_ldisc { |
205 | struct tty_ldisc_ops *ops; | 205 | struct tty_ldisc_ops *ops; |
206 | atomic_t users; | 206 | struct tty_struct *tty; |
207 | wait_queue_head_t wq_idle; | ||
208 | }; | 207 | }; |
209 | 208 | ||
210 | #define TTY_LDISC_MAGIC 0x5403 | 209 | #define TTY_LDISC_MAGIC 0x5403 |