summaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-02 15:21:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-02 15:21:43 -0700
commitf309532bf3e1cc1b787403d84e3039812a7dbe50 (patch)
tree6508ac81e94bfc137d1d9a55b973a2e0e0ac007b /include/linux/tty.h
parent233e562eac549f4f719176bbddeb50c3f17a9c8d (diff)
downloadlinux-f309532bf3e1cc1b787403d84e3039812a7dbe50.tar.gz
linux-f309532bf3e1cc1b787403d84e3039812a7dbe50.tar.bz2
linux-f309532bf3e1cc1b787403d84e3039812a7dbe50.zip
tty: Revert the tty locking series, it needs more work
This reverts the tty layer change to use per-tty locking, because it's not correct yet, and fixing it will require some more deep surgery. The main revert is d29f3ef39be4 ("tty_lock: Localise the lock"), but there are several smaller commits that built upon it, they also get reverted here. The list of reverted commits is: fde86d310886 - tty: add lockdep annotations 8f6576ad476b - tty: fix ldisc lock inversion trace d3ca8b64b97e - pty: Fix lock inversion b1d679afd766 - tty: drop the pty lock during hangup abcefe5fc357 - tty/amiserial: Add missing argument for tty_unlock() fd11b42e3598 - cris: fix missing tty arg in wait_event_interruptible_tty call d29f3ef39be4 - tty_lock: Localise the lock The revert had a trivial conflict in the 68360serial.c staging driver that got removed in the meantime. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 4990ef2b1fb7..9f47ab540f65 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -268,7 +268,6 @@ struct tty_struct {
struct mutex ldisc_mutex;
struct tty_ldisc *ldisc;
- struct mutex legacy_mutex;
struct mutex termios_mutex;
spinlock_t ctrl_lock;
/* Termios values are protected by the termios mutex */
@@ -606,12 +605,8 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
/* tty_mutex.c */
/* functions for preparation of BKL removal */
-extern void __lockfunc tty_lock(struct tty_struct *tty);
-extern void __lockfunc tty_unlock(struct tty_struct *tty);
-extern void __lockfunc tty_lock_pair(struct tty_struct *tty,
- struct tty_struct *tty2);
-extern void __lockfunc tty_unlock_pair(struct tty_struct *tty,
- struct tty_struct *tty2);
+extern void __lockfunc tty_lock(void) __acquires(tty_lock);
+extern void __lockfunc tty_unlock(void) __releases(tty_lock);
/*
* this shall be called only from where BTM is held (like close)
@@ -626,9 +621,9 @@ extern void __lockfunc tty_unlock_pair(struct tty_struct *tty,
static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
long timeout)
{
- tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */
+ tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */
tty_wait_until_sent(tty, timeout);
- tty_lock(tty);
+ tty_lock();
}
/*
@@ -643,16 +638,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
*
* Do not use in new code.
*/
-#define wait_event_interruptible_tty(tty, wq, condition) \
+#define wait_event_interruptible_tty(wq, condition) \
({ \
int __ret = 0; \
if (!(condition)) { \
- __wait_event_interruptible_tty(tty, wq, condition, __ret); \
+ __wait_event_interruptible_tty(wq, condition, __ret); \
} \
__ret; \
})
-#define __wait_event_interruptible_tty(tty, wq, condition, ret) \
+#define __wait_event_interruptible_tty(wq, condition, ret) \
do { \
DEFINE_WAIT(__wait); \
\
@@ -661,9 +656,9 @@ do { \
if (condition) \
break; \
if (!signal_pending(current)) { \
- tty_unlock(tty); \
+ tty_unlock(); \
schedule(); \
- tty_lock(tty); \
+ tty_lock(); \
continue; \
} \
ret = -ERESTARTSYS; \