From: Greg KH <greg@kroah.com>
To: Michael Haardt <michael@moria.de>
Cc: linux-serial@vger.kernel.org
Subject: Re: How to disable the transmit FIFO?
Date: Thu, 18 Nov 2010 12:11:25 -0800 [thread overview]
Message-ID: <20101118201125.GA26323@kroah.com> (raw)
In-Reply-To: <E1PJAfx-0000gW-8e@palantir.moria.de>
On Thu, Nov 18, 2010 at 09:01:45PM +0100, Michael Haardt wrote:
> > > I miss a way to disable the transmit FIFO.
> >
> > From userspace or from within a kernel driver?
>
> >From userspace.
>
> > > UARTs that don't do hardware handshaking in hardware, but use a transmit
> > > FIFO, can only be used if the peer can deal with the delayed handshaking
> > > response.
> > >
> > > If slow peers can not receive at line rate, hardware handshaking will
> > > still cause overruns with Linux as sender, because Linux fills the
> > > transmit FIFO and transmission continues at worst for 16 characters with
> > > a 16550 after CTS was asserted.
> > >
> > > So, how can I fix hardware flow control response to the non-delayed
> > > behaviour as it worked with a 8250 or 16450 by disabling the transmit
> > > FIFO?
> >
> > So you are saying this used to work and now it doesn't?
>
> It used to work with old non-FIFO UARTs (8250, 16450) and does not work
> with the slightly newer FIFO-UARTs (16550 and up, probably excluding
> those that can do RTS/CTS flow control in hardware).
It also breaks down massively with usb to serial devices where the delay
is a lot bigger :)
> A transmitter FIFO on a UART that can not do RTS/CTS flow control in
> hardware delays the flow control response by the size of the FIFO.
> By the time Linux notices CTS being set, the FIFO is already filled and
> the transmitter keeps sending, despite the peer asking to pause.
>
> It is desirable that flow control has minimal delays from seeing CTS
> to pausing the flow. Given a 16550 UART, you have to disable the
> transmitter FIFO for that. One could argue whether the default should
> be high throughput (use the FIFO and delay handshaking) or correct flow
> control (no FIFO and near instant handshaking). Most systems default
> to the first.
>
> The admin has to know if the peer allows delayed flow control and
> configure it for the affected UART ports. Windows allows exactly that
> and the MS knowledge base correctly describes that the FIFO size may
> cause data overruns, suggesting to reduce it until the problem goes away.
> A binary switch, as offered by BSD, probably suffices, though.
What is the BSD user/kernel api that they have to provide this?
thanks,
greg k-h
next prev parent reply other threads:[~2010-11-18 20:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 9:15 How to disable the transmit FIFO? Michael Haardt
2010-11-18 16:41 ` Greg KH
2010-11-18 20:01 ` Michael Haardt
2010-11-18 20:05 ` Grant Edwards
2010-11-19 1:25 ` Ted Ts'o
2010-11-19 4:31 ` Grant Edwards
2010-11-24 12:47 ` Michael Haardt
2010-11-24 14:56 ` Grant Edwards
2010-11-18 20:11 ` Greg KH [this message]
2010-11-18 20:58 ` Michael Haardt
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=20101118201125.GA26323@kroah.com \
--to=greg@kroah.com \
--cc=linux-serial@vger.kernel.org \
--cc=michael@moria.de \
/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;
as well as URLs for NNTP newsgroup(s).