]> git.baikalelectronics.ru Git - kernel.git/commit
pty: avoid forcing 'low_latency' tty flag
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Wed, 29 Jul 2009 19:15:56 +0000 (12:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 29 Jul 2009 19:15:56 +0000 (12:15 -0700)
commitd1e7c0ae6f1f22ab4596070cbb005c22fc0852a3
tree12b40fd776f653484a77fd84f07cc304276141b1
parentace479bebfebbc8dd96951724e8625dc25c0d5d6
pty: avoid forcing 'low_latency' tty flag

We really don't want to mark the pty as a low-latency device, because as
Alan points out, the ->write method can be called from an IRQ (ppp?),
and that means we can't use ->low_latency=1 as we take mutexes in the
low_latency case.

So rather than using low_latency to force the written data to be pushed
to the ldisc handling at 'write()' time, just make the reader side (or
the poll function) do the flush when it checks whether there is data to
be had.

This also fixes the problem with lost data in an emacs compile buffer
(bugzilla 13815), and we can thus revert the low_latency pty hack
(commit 2223e311fbd812cf01a334de155811202a8cd176: "pty: quickfix for the
pty ENXIO timing problems").

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[ Modified to do the tty_flush_to_ldisc() inside input_available_p() so
  that it triggers for both read and poll()  - Linus]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/n_tty.c
drivers/char/pty.c
drivers/char/tty_buffer.c
include/linux/tty.h