From: Russell King <rmk@arm.linux.org.uk>
To: Dan Christian <dchristian@mail.arc.nasa.gov>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: 2.4.18 serial drops characters with 16654
Date: Thu, 19 Sep 2002 19:43:09 +0100 [thread overview]
Message-ID: <20020919194309.D11763@flint.arm.linux.org.uk> (raw)
In-Reply-To: <200209191124.24964.dchristian@mail.arc.nasa.gov>; from dchristian@mail.arc.nasa.gov on Thu, Sep 19, 2002 at 11:24:24AM -0700
On Thu, Sep 19, 2002 at 11:24:24AM -0700, Dan Christian wrote:
> This still isn't getting at the core problem. I'm sending data out the
> port and dropping characters. The receive works fine.
>
> It can't be a problem with the receiving device being over-run, since
> the 16550 works (even though it sends several bytes after CTS drops),
> and the 16654 doesn't (it stops after the current byte).
>
> I think that data must be lost when the receiving device drops CTS.
> Either this is a hardware flaw (and data is lost from the transmit
> FIFO), or there is some kind of race condition between the CTS drop and
> re-loading the FIFO.
Ok, it doesn't sound like FIFO underrun, but FIFO overrun. In theory,
this should never ever happen on the transmit side, however you appear
to be seeing exactly this.
The first thing I'll ask is that you check that the port is being
recognised as a ST16654 and not 16650V2. The former has 64 bytes of
FIFO, the latter has 256 bytes.
Secondly, how many characters on average do you seem to be dropping in
one go? I'm not expecting an exact figure, just a rough idea will
probably do.
Thirdly, there is a possibility here that could be causing this, and
it surrounds the following code in transmit_chars() in serial.c:
count = info->xmit_fifo_size;
do {
serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]);
info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
info->state->icount.tx++;
if (info->xmit.head == info->xmit.tail)
break;
} while (--count > 0);
We always load a full FIFO-size chunk of data into the UART whenever
it says "hey, my transmit holding register is empty" since the FIFO
should be empty. I'm wondering if the ST16654 is giving an early
indication.
Could you try changing the first line in drivers/char/serial.c to:
count = info->xmit_fifo_size / 2;
to find out whether that improves the situation? Don't worry, I don't
intend this as a fix. Its more to (dis-)prove the point.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2002-09-19 18:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-11 14:28 2.4.18 serial drops characters with 16654 Ed Vance
2002-09-11 23:12 ` Andreas Steinmetz
2002-09-12 8:20 ` Alan Cox
2002-09-19 17:27 ` Dan Christian
2002-09-19 17:38 ` Alan Cox
2002-09-19 18:01 ` Russell King
2002-09-19 18:38 ` Dan Christian
2002-09-19 18:24 ` Dan Christian
2002-09-19 18:42 ` Alan Cox
2002-09-19 18:43 ` Russell King [this message]
2002-09-12 14:55 ` Stuart MacDonald
-- strict thread matches above, loose matches on Subject: below --
2002-09-10 22:22 Dan Christian
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=20020919194309.D11763@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dchristian@mail.arc.nasa.gov \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox