Paul Fulghum ae030e435f tty_set_ldisc() receive_room fix
Fix tty_set_ldisc in tty_io.c so that tty->receive_room is only cleared if
actually changing line disciplines.

Without this fix a problem occurs when requesting the line discipline to
change to the same line discipline.  In this case tty->receive_room is
cleared but ldisc->open() is not called to set tty->receive_room back to a
sane value.  The result is that tty->receive_room is stuck at 0 preventing
the tty flip buffer from passing receive data to the line discipline.

For example: a switch from N_TTY to N_TTY followed by a select() call for
read input results in data never being received because tty->receive_room
is stuck at zero.

A switch from N_TTY to N_TTY followed by a read() call works because the
read() call itself sets tty->receive_room correctly (but select does not).

Previously (< 2.6.18) this was not a problem because the tty flip buffer
pushed data to the line discipline without regard for tty->receive room.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-09 12:30:49 -07:00
..
2007-05-08 13:37:51 +10:00
2007-05-09 12:30:49 -07:00
2007-05-08 11:15:20 -07:00
2007-05-09 12:30:49 -07:00
2007-02-17 18:57:09 +01:00
2007-05-08 11:15:12 -07:00
2006-12-07 08:39:41 -08:00
2007-05-08 11:15:09 -07:00
2007-05-08 11:15:13 -07:00
2006-10-04 07:55:13 -07:00
2006-12-08 08:28:57 -08:00
2006-12-08 08:28:57 -08:00
2007-05-08 11:15:24 -07:00
2007-02-11 10:51:26 -08:00
2007-05-08 11:15:24 -07:00
2007-03-17 01:03:26 +00:00
2007-02-20 17:11:55 +00:00
2007-05-07 12:13:04 -07:00
2007-05-08 11:15:14 -07:00
2007-02-12 09:48:30 -08:00
2007-05-08 11:15:13 -07:00
2007-02-12 09:48:30 -08:00
2006-12-13 09:05:49 -08:00
2006-12-08 08:28:59 -08:00
2007-02-12 09:48:30 -08:00
2007-05-08 11:15:05 -07:00
2007-05-09 12:30:49 -07:00
2006-12-20 16:37:48 +11:00