public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Raphael Hertzog <hertzog@debian.org>
To: Lee Revell <rlrevell@joe-job.com>
Cc: Paul Fulghum <paulkf@microgate.com>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: How to avoid serial port buffer overruns?
Date: Wed, 23 Aug 2006 14:45:41 +0200	[thread overview]
Message-ID: <20060823124541.GD5137@ouaza.com> (raw)
In-Reply-To: <1155929467.2924.41.camel@mindpipe>

Hello,

I took the time to try some of your suggestions and I managed to get rid
of the overruns.

On Fri, 18 Aug 2006, Lee Revell wrote:
> Have you tried it with HZ=100?  HZ=1000 might just be too much for that
> board.

This indeed was a major problem and a bad choice of mine at the very
beginning. It goes way better with HZ=100.

On Fri, 18 Aug 2006, Paul Fulghul wrote:
> For fun, have you tried playing with the rx FIFO trigger
> level in the 16550A entry in drivers/serial/8250.c ?
> You could try replacing UART_FCR_R_TRIG_10 (8 char trigger)
> with UART_FCR_R_TRIG_01 (4 char trigger) or even
> UART_FCR_R_TRIG_00 (1 char trigger).
> That creates more interrupts, but allows
> more time to activate the ISR before overrun.

I changed the rx FIFO trigger level to 1 byte (UART_FCR_R_TRIG_00) and it
helped a lot as well. With this combination I completely resolved the
problem of overruns at full speed (115200 bauds).

For the sake of comparison, I made a similar change to the 2.4.31 kernel I
was using (ie a kernel with low latency/preemptible kernel patches).

It helped a lot as well: most of the time I wouldn't have overruns (before
they were very frequent, like at least one overrun in 10k chars received).
However from time to time I would suffer from a single big overrun (like 30
chars lost). And using heavily the disk on module will increase the
likelihood to have a buffer overrun.

With the 2.6.17.7 kernel (CONFIG_HZ=100 and patched to trigger IRQ at
1 byte received), I have been completely unable to reproduce the buffer
overruns whatever read/write operation I've been triggering during the data
exchange.

So all in all, the 2.6 kernel behaves better than the 2.4 in this
case.

Cheers,
-- 
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/

  reply	other threads:[~2006-08-23 12:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-16 10:45 How to avoid serial port buffer overruns? Raphael Hertzog
2006-08-16 14:31 ` Lennart Sorensen
2006-08-16 14:57   ` Raphael Hertzog
2006-08-16 18:44 ` Lee Revell
2006-08-16 19:23   ` Paul Fulghum
2006-08-16 21:12     ` Lee Revell
2006-08-16 22:24       ` Paul Fulghum
2006-08-16 23:10         ` Russell King
2006-08-16 23:15           ` Lee Revell
2006-08-16 23:19             ` Russell King
2006-08-16 23:28               ` Lee Revell
2006-08-17  0:15                 ` R: " Giampaolo Tomassoni
2006-08-18  8:48                 ` Giampaolo Tomassoni
2006-08-18 17:00                   ` Lee Revell
2006-08-18 17:04                     ` Russell King
2006-08-18 17:30                       ` Lee Revell
2006-08-18 18:34                         ` Russell King
2006-08-18 18:52                           ` Lee Revell
2006-08-18 19:01                             ` Russell King
2006-08-18 19:07                               ` Russell King
2006-08-18 19:09                               ` Lee Revell
2006-08-17  9:20           ` Alan Cox
2006-08-17  9:28             ` Russell King
2006-08-17 11:57               ` Alan Cox
2006-08-17 13:29                 ` Paul Fulghum
2006-08-17 15:48                 ` Raphael Hertzog
2006-08-17 16:10         ` Raphael Hertzog
2006-08-17 16:40           ` Paul Fulghum
2006-08-18 19:31           ` Lee Revell
2006-08-23 12:45             ` Raphael Hertzog [this message]
     [not found] <fa.AByCsBI8k71hMVzCyQVimrLiDU4@ifi.uio.no>
2006-08-16 14:35 ` Robert Hancock
2006-08-16 14:42   ` Erik Mouw

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=20060823124541.GD5137@ouaza.com \
    --to=hertzog@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulkf@microgate.com \
    --cc=rlrevell@joe-job.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