mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 22:24:09 +08:00
f309532bf3
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 isd29f3ef39b
("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:fde86d3108
- tty: add lockdep annotations8f6576ad47
- tty: fix ldisc lock inversion traced3ca8b64b9
- pty: Fix lock inversionb1d679afd7
- tty: drop the pty lock during hangupabcefe5fc3
- tty/amiserial: Add missing argument for tty_unlock()fd11b42e35
- cris: fix missing tty arg in wait_event_interruptible_tty calld29f3ef39b
- 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>
33 lines
659 B
C
33 lines
659 B
C
#include <linux/tty.h>
|
|
#include <linux/module.h>
|
|
#include <linux/kallsyms.h>
|
|
#include <linux/semaphore.h>
|
|
#include <linux/sched.h>
|
|
|
|
/*
|
|
* The 'big tty mutex'
|
|
*
|
|
* This mutex is taken and released by tty_lock() and tty_unlock(),
|
|
* replacing the older big kernel lock.
|
|
* It can no longer be taken recursively, and does not get
|
|
* released implicitly while sleeping.
|
|
*
|
|
* Don't use in new code.
|
|
*/
|
|
static DEFINE_MUTEX(big_tty_mutex);
|
|
|
|
/*
|
|
* Getting the big tty mutex.
|
|
*/
|
|
void __lockfunc tty_lock(void)
|
|
{
|
|
mutex_lock(&big_tty_mutex);
|
|
}
|
|
EXPORT_SYMBOL(tty_lock);
|
|
|
|
void __lockfunc tty_unlock(void)
|
|
{
|
|
mutex_unlock(&big_tty_mutex);
|
|
}
|
|
EXPORT_SYMBOL(tty_unlock);
|