[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
@@ -784,11 +784,8 @@ restart:
|
||||
}
|
||||
|
||||
clear_bit(TTY_LDISC, &tty->flags);
|
||||
clear_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
if (o_tty) {
|
||||
if (o_tty)
|
||||
clear_bit(TTY_LDISC, &o_tty->flags);
|
||||
clear_bit(TTY_DONT_FLIP, &o_tty->flags);
|
||||
}
|
||||
spin_unlock_irqrestore(&tty_ldisc_lock, flags);
|
||||
|
||||
/*
|
||||
@@ -1955,7 +1952,6 @@ static void release_dev(struct file * filp)
|
||||
* race with the set_ldisc code path.
|
||||
*/
|
||||
clear_bit(TTY_LDISC, &tty->flags);
|
||||
clear_bit(TTY_DONT_FLIP, &tty->flags);
|
||||
cancel_delayed_work(&tty->buf.work);
|
||||
|
||||
/*
|
||||
@@ -2784,13 +2780,6 @@ static void flush_to_ldisc(void *private_)
|
||||
if (disc == NULL) /* !TTY_LDISC */
|
||||
return;
|
||||
|
||||
if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
|
||||
/*
|
||||
* Do it after the next timer tick:
|
||||
*/
|
||||
schedule_delayed_work(&tty->buf.work, 1);
|
||||
goto out;
|
||||
}
|
||||
spin_lock_irqsave(&tty->buf.lock, flags);
|
||||
while((tbuf = tty->buf.head) != NULL) {
|
||||
while ((count = tbuf->commit - tbuf->read) != 0) {
|
||||
@@ -2809,7 +2798,7 @@ static void flush_to_ldisc(void *private_)
|
||||
tty_buffer_free(tty, tbuf);
|
||||
}
|
||||
spin_unlock_irqrestore(&tty->buf.lock, flags);
|
||||
out:
|
||||
|
||||
tty_ldisc_deref(disc);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user