diff options
author | Paul Fulghum <paulkf@microgate.com> | 2006-06-28 07:26:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 17:59:05 -0400 |
commit | 817d6d3bceaf34c99f5343820f9b9e6021f0655c (patch) | |
tree | 651104833124262db46c2a372b7adb55289cd8dd /drivers/char/tty_io.c | |
parent | e0ac4761fa52acda90f9f53819c81474b511e3af (diff) |
[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>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r-- | drivers/char/tty_io.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index bd74e82d8a72..b846d87f2b56 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -784,11 +784,8 @@ restart: | |||
784 | } | 784 | } |
785 | 785 | ||
786 | clear_bit(TTY_LDISC, &tty->flags); | 786 | clear_bit(TTY_LDISC, &tty->flags); |
787 | clear_bit(TTY_DONT_FLIP, &tty->flags); | 787 | if (o_tty) |
788 | if (o_tty) { | ||
789 | clear_bit(TTY_LDISC, &o_tty->flags); | 788 | clear_bit(TTY_LDISC, &o_tty->flags); |
790 | clear_bit(TTY_DONT_FLIP, &o_tty->flags); | ||
791 | } | ||
792 | spin_unlock_irqrestore(&tty_ldisc_lock, flags); | 789 | spin_unlock_irqrestore(&tty_ldisc_lock, flags); |
793 | 790 | ||
794 | /* | 791 | /* |
@@ -1955,7 +1952,6 @@ static void release_dev(struct file * filp) | |||
1955 | * race with the set_ldisc code path. | 1952 | * race with the set_ldisc code path. |
1956 | */ | 1953 | */ |
1957 | clear_bit(TTY_LDISC, &tty->flags); | 1954 | clear_bit(TTY_LDISC, &tty->flags); |
1958 | clear_bit(TTY_DONT_FLIP, &tty->flags); | ||
1959 | cancel_delayed_work(&tty->buf.work); | 1955 | cancel_delayed_work(&tty->buf.work); |
1960 | 1956 | ||
1961 | /* | 1957 | /* |
@@ -2784,13 +2780,6 @@ static void flush_to_ldisc(void *private_) | |||
2784 | if (disc == NULL) /* !TTY_LDISC */ | 2780 | if (disc == NULL) /* !TTY_LDISC */ |
2785 | return; | 2781 | return; |
2786 | 2782 | ||
2787 | if (test_bit(TTY_DONT_FLIP, &tty->flags)) { | ||
2788 | /* | ||
2789 | * Do it after the next timer tick: | ||
2790 | */ | ||
2791 | schedule_delayed_work(&tty->buf.work, 1); | ||
2792 | goto out; | ||
2793 | } | ||
2794 | spin_lock_irqsave(&tty->buf.lock, flags); | 2783 | spin_lock_irqsave(&tty->buf.lock, flags); |
2795 | while((tbuf = tty->buf.head) != NULL) { | 2784 | while((tbuf = tty->buf.head) != NULL) { |
2796 | while ((count = tbuf->commit - tbuf->read) != 0) { | 2785 | while ((count = tbuf->commit - tbuf->read) != 0) { |
@@ -2809,7 +2798,7 @@ static void flush_to_ldisc(void *private_) | |||
2809 | tty_buffer_free(tty, tbuf); | 2798 | tty_buffer_free(tty, tbuf); |
2810 | } | 2799 | } |
2811 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 2800 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
2812 | out: | 2801 | |
2813 | tty_ldisc_deref(disc); | 2802 | tty_ldisc_deref(disc); |
2814 | } | 2803 | } |
2815 | 2804 | ||