From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Richard Schmitt <rschmitt@bluepeach.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: TTY/Serial Driver Hangs in tty_wait_until_sent, analysis, and recommendations
Date: Sat, 23 May 2009 18:53:38 +0100 [thread overview]
Message-ID: <20090523185338.5754e0f5@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <60483.14588.qm@web1112.biz.mail.sk1.yahoo.com>
> So, the console is hung. Control C characters and Control Q characters are not processed and there is nothing you can do short of logging on through a different port and killing the shell on the console.
(or reading it from another process if you diagnosis is correct - and it
sounds so)
> I think there are two long term solutions to this: 1) have the low level serial port drivers (i.e. 8250) treat XON/XOFF out of band and have some back door into the line discipline driver to restart the serial line without needing input buffer space and 2) to change the tty_ioctl handling of a WAIT call to flush the output buffer if the port is stopped. I figure either of these approaches alters the serial behavior enough that it is more then just a bug fix.
#2 is out of spec for the standards and pushing the flow control down
into the drivers is a major project (and very hard to do as flow control
is discipline dependant sometimes). Like a lot of the tty layer its all
quite ugly 8(
The obvious quick hack would I think be to add an optional ldisc method
that is called when new data arrives which cannot be queued due to
throttling and get to snoop on the buffer and perhaps optionally trim
bytes out of it.
If flush_to_ldisc called such a routine for those bytes that didn't fit
then something like
if (c == START_CHAR(tty) && I_IXON(tty) && tty->stopped) {
start_tty(tty);
process_echoes(tty);
}
in the ldisc handler for n_tty would uncork the bottle.
prev parent reply other threads:[~2009-05-23 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-23 16:27 Richard Schmitt
2009-05-23 17:53 ` Alan Cox [this message]
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=20090523185338.5754e0f5@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rschmitt@bluepeach.com \
/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®