[PATCH] remove TTY_DONT_FLIP
Remove TTY_DONT_FLIP tty flag. This flag was introduced in 2.1.X kernels to prevent the N_TTY line discipline functions read_chan() and n_tty_receive_buf() from running at the same time. 2.2.15 introduced tty->read_lock to protect access to the N_TTY read buffer, which is the only state requiring protection between these two functions. The current TTY_DONT_FLIP implementation is broken for SMP, and is not universally honored by drivers that send data directly to the line discipline receive_buf function. Because TTY_DONT_FLIP is not necessary, is broken in implementation, and is not universally honored, it is removed. Signed-off-by: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e0ac4761fa
commit
817d6d3bce
@@ -1132,7 +1132,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
|
||||
* buffer, and once to drain the space from the (physical) beginning of
|
||||
* the buffer to head pointer.
|
||||
*
|
||||
* Called under the tty->atomic_read_lock sem and with TTY_DONT_FLIP set
|
||||
* Called under the tty->atomic_read_lock sem
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1271,7 +1271,6 @@ do_it_again:
|
||||
}
|
||||
|
||||
add_wait_queue(&tty->read_wait, &wait);
|
||||
set_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
while (nr) {
|
||||
/* First test for status change. */
|
||||
if (tty->packet && tty->link->ctrl_status) {
|
||||
@@ -1315,9 +1314,7 @@ do_it_again:
|
||||
break;
|
||||
}
|
||||
n_tty_set_room(tty);
|
||||
clear_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
timeout = schedule_timeout(timeout);
|
||||
set_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
continue;
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
@@ -1394,7 +1391,6 @@ do_it_again:
|
||||
if (time)
|
||||
timeout = time;
|
||||
}
|
||||
clear_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
mutex_unlock(&tty->atomic_read_lock);
|
||||
remove_wait_queue(&tty->read_wait, &wait);
|
||||
|
||||
|
Reference in New Issue
Block a user