From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Robert Hancock <hancockr@shaw.ca>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
Lee Howard <faxguy@howardsilvan.com>,
linux-serial@vger.kernel.org, tytso@mit.edu,
linux-kernel@vger.kernel.org
Subject: Re: serial flow control appears broken
Date: Sat, 28 Jul 2007 10:28:42 +0100 [thread overview]
Message-ID: <20070728092842.GC26443@flint.arm.linux.org.uk> (raw)
In-Reply-To: <46AA3801.7090204@shaw.ca>
On Fri, Jul 27, 2007 at 12:22:57PM -0600, Robert Hancock wrote:
> Maciej W. Rozycki wrote:
> > The TTY line discipline driver could do that based on the amount of
> >received data present in its buffer. And it should if asked to (a brief
> >look at drivers/char/n_tty.c reveals it does; obviously there may be a bug
>
> Really, where? In my look through the code I haven't found any mechanism
> that would result in RTS being lowered based on TTY buffers filling up,
> at least not in the 8250 case.
That's something for the line discipline to decide.
> In this situation, though, it appears it's not the TTY buffers that are
> filling but the UART's own buffer. I would think this must be caused by
> some kind of interrupt latency that results in not draining the FIFO in
> time.
Correct, and suggested approach to tracking down the culpret has been
mentioned in a previous email.
Also note that there's nothing the serial driver can do to detect this
condition before it occurs. The problem occurs because the serial driver
is starved of CPU time due to other parts of the system, and the driver
has precisely zero knowledge as to when that's going to happen.
There are two possible scenarios when such starvation can occur:
1. interrupts are disabled for a long period.
2. the serial interrupt has started to run, but has been interrupted
by _another_ interrupt which runs for a long period.
Essentially, any complex interrupt handler (such as an IDE interrupt
doing a multi-sector PIO transfer _in interrupt context_) can cause this
kind of starvation. That's why Linux 1.x had bottom halves - so that
the time consuming work could be moved out of the interrupt handler,
thereby causing minimal the blockage of other interrupts.
Unfortunately, that kind of design has been long since forgotten.
Apparantly modern machines are fast enough that it doesn't have to be
worried about anymore... Or are they?
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2007-07-28 9:29 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.Z6O0xFRT69zes0Mg+agt3Uiwux4@ifi.uio.no>
2007-07-26 7:20 ` serial flow control appears broken Robert Hancock
2007-07-26 16:08 ` Lee Howard
2007-07-26 16:31 ` Alan Cox
2007-07-27 5:53 ` Lee Howard
2007-07-27 11:47 ` Alan Cox
2007-07-27 17:36 ` Lee Howard
2007-07-27 13:45 ` Tilman Schmidt
2007-07-27 19:34 ` Paul Fulghum
2007-08-27 20:38 ` Paul Fulghum
2007-07-27 20:48 ` Lee Howard
2007-07-27 23:28 ` Paul Fulghum
2007-07-28 4:51 ` Lee Howard
2007-07-28 9:18 ` Russell King
2007-07-28 12:00 ` Alan Cox
2007-07-28 15:39 ` Lee Howard
2007-08-01 21:54 ` Frantisek Rysanek
2007-07-28 16:41 ` Ray Lee
2007-08-04 18:21 ` Lee Howard
2007-08-04 22:07 ` Paul Fulghum
2007-08-05 0:00 ` Lee Howard
2007-08-05 14:52 ` Paul Fulghum
2007-07-27 19:34 ` Paul Fulghum
2007-07-27 20:05 ` Lee Howard
2007-07-27 11:32 ` Maciej W. Rozycki
2007-07-27 17:11 ` Lee Howard
2007-07-27 17:41 ` Alan Cox
2007-07-27 17:53 ` Maciej W. Rozycki
2007-07-27 18:11 ` Lee Howard
2007-07-30 9:36 ` Maciej W. Rozycki
2007-07-27 18:22 ` Robert Hancock
2007-07-27 18:46 ` Paul Fulghum
2007-07-27 19:05 ` Paul Fulghum
2007-07-30 9:39 ` Maciej W. Rozycki
2007-07-27 19:14 ` Paul Fulghum
2007-07-28 9:28 ` Russell King [this message]
2007-07-30 9:45 ` Maciej W. Rozycki
2007-07-30 9:59 ` Russell King
2007-08-02 14:57 ` Mark Lord
2007-08-02 16:14 ` Robert Hancock
2007-08-02 16:29 ` Mark Lord
2007-08-02 16:40 ` Robert Hancock
2007-08-02 17:13 ` Alan Cox
2007-08-04 19:38 ` Lee Howard
2007-08-02 16:57 ` Alan Cox
2007-08-02 17:02 ` Robert Hancock
2007-08-03 9:32 ` Maciej W. Rozycki
2007-07-30 9:34 ` Maciej W. Rozycki
2007-08-04 18:19 ` Lee Howard
2007-07-26 1:52 Lee Howard
2007-07-26 12:34 ` Uwe Kleine-König
2007-07-26 12:34 ` Uwe Kleine-König
2007-07-26 16:28 ` Lee Howard
2007-07-26 16:28 ` Lee Howard
2007-07-26 16:41 ` Alan Cox
2007-07-27 6:17 ` Lee Howard
2007-07-27 11:56 ` Alan Cox
2007-07-27 18:00 ` Lee Howard
2007-07-26 15:51 ` Tosoni
2007-07-26 16:31 ` Lee Howard
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=20070728092842.GC26443@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=faxguy@howardsilvan.com \
--cc=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.