All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Haardt <michael@moria.de>
To: greg@kroah.com
Cc: linux-serial@vger.kernel.org
Subject: Re: How to disable the transmit FIFO?
Date: Thu, 18 Nov 2010 21:01:45 +0100	[thread overview]
Message-ID: <E1PJAfx-0000gW-8e@palantir.moria.de> (raw)
In-Reply-To: <20101118164122.GB2855@kroah.com>

> > 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).

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.

Michael

  reply	other threads:[~2010-11-18 20:01 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 [this message]
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
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=E1PJAfx-0000gW-8e@palantir.moria.de \
    --to=michael@moria.de \
    --cc=greg@kroah.com \
    --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 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.