Skip to content

tty: Fix ^C echo

Peter Hurley linux-serial lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tty: Fix stale tty_buffer_flush() commentdrivers/tty/tty_buffer.c+1 -30 replies
2/4tty: Add flush_nested() tty driver method and accessordrivers/tty/n_tty.c drivers/tty/tty_ioctl.c include/linux/tty.h +1 more+25 -20 replies
3/4tty: Fix pty flushdrivers/tty/pty.c drivers/tty/tty_buffer.c include/linux/tty_flip.h+108 -10 replies
4/4n_tty: Flush echoes for signal charsdrivers/tty/n_tty.c+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH tty-next 0/4] tty: Fix ^C echo

Greg,

Sometimes when interrupting terminal output, the '^C' won't be echoed until more output is echoed. This is fairly repeatable by interrupting 'cat large-file'.

The common reason for this is because the tty write buffer is full, even though the write buffer _should_ have been flushed already. Because of a known deadlock, the pty driver does not perform a write buffer flush in its flush_buffer() method.

[Refer to the FIXME in pty_flush_buffer() from commit d945cb9cce20ac7143c2de8d88b187f62db99bdc,
'pty: Rework the pty layer to use the normal buffering logic']

Patch 1 fixes a stale comment.
Patch 2 adds the necessary interfaces to avoid direct linkage between the N_TTY line discipline and the pty driver. Patch 3 avoids the deadlock while performing the write buffer flush. Patch 4 fixes a less common condition introduced by the echo batch processing added in 3.12.

Alan,

I cc'd you because of your recent involvement in other tty patches/bug fixes and because it's your FIXME comment. Feel free to ignore and/or let me know you would prefer not to be bothered.

Regards,

Peter Hurley (4):
tty: Fix stale tty_buffer_flush() comment
tty: Add flush_nested() tty driver method and accessor
tty: Fix pty flush
n_tty: Flush echoes for signal chars

 drivers/tty/n_tty.c        |  8 +++--
 drivers/tty/pty.c          | 32 ++++++++++++++++++-
 drivers/tty/tty_buffer.c   | 79 ++++++++++++++++++++++++++++++++++++++++++++--
 drivers/tty/tty_ioctl.c    | 21 ++++++++++++
 include/linux/tty.h        |  1 +
 include/linux/tty_driver.h |  1 +
 include/linux/tty_flip.h   |  2 ++
 7 files changed, 137 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.1.2