From: Cheng Yongkang <teel4res@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [BUG] tty: TCIOFF/TCION under TCOOFF lose the character on pty and vt
Date: Sun, 15 Nov 2026 08:36:38 -0800 [thread overview]
Message-ID: <20261115163638.226086-1-teel4res@gmail.com> (raw)
Hi Greg, Jiri,
I hit a small corner case in tty_send_xchar(). It only happens on a
pty or the vt console after output was suspended with TCOOFF, so it
may not be worth fixing.
Under TCOOFF, tcflow(TCIOFF) and tcflow(TCION) still send the STOP or
START character on most ttys. serial_core UARTs do it through
->send_xchar(). Drivers without ->send_xchar() go through
->write(): __start_tty() does nothing while tco_stopped is set, but
usb-serial, cdc-acm and u_serial do not check the stopped state in
->write(), so the character still goes out.
pty_write() and the vt console's write return 0 while the tty is
stopped, though. tty_send_xchar() ignores that and returns 0, so on a
pty or vt the call reports success but the character is never sent,
not even after TCOON.
On v7.3, with TCOOFF in effect, TCIOFF and TCION returned 0 on all of
these. 8250, ftdi_sio, cdc-acm and u_serial delivered the character
before TCOON. pty and vt delivered nothing, before or after TCOON.
The code is unchanged in next-20261113.
tty_send_xchar() could return an error such as -EIO when the write
took no byte. Since usb-serial and u_serial also return 0 when their
FIFO is full, that should probably be limited to the case where the
tty is stopped. I can send a patch if you want one.
Thanks,
Cheng Yongkang
reply other threads:[~2026-11-15 16:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261115163638.226086-1-teel4res@gmail.com \
--to=teel4res@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®