From: Mathias Nyman <mathias.nyman@nokia.com>
To: linux-serial@vger.kernel.org
Cc: Mathias Nyman <mathias.nyman@nokia.com>
Subject: [PATCH] serial: 8250.c: Clear FIFOs before enabling them
Date: Wed, 6 Oct 2010 12:35:20 +0300 [thread overview]
Message-ID: <1286357720-17351-1-git-send-email-mathias.nyman@nokia.com> (raw)
There's a short time when FIFO's are disabled and interrupts enabled
between startup and set_termios.
If rx FIFO is not cleared before enabled, and there are lots of serial I/O,
an interrupt indicating FIFO data error can occur.
(LSR register bit 7 set, no other error bits set).
The current interrupt handle is unable to clear this interrupt and will continue looping with a
flood of "too much work" messages.
This is seen on an omap board with ST16654 type uart if a key is kept pressed in serial console while
booting.
Signed-off-by: Mathias Nyman <mathias.nyman@nokia.com>
---
drivers/serial/8250.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 5ed1b82..d3add25 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2403,6 +2403,8 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
if (fcr & UART_FCR_ENABLE_FIFO) {
/* emulated UARTs (Lucent Venus 167x) need two steps */
serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
+ serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO |
+ UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
}
serial_outp(up, UART_FCR, fcr); /* set fcr */
}
--
1.5.6.5
reply other threads:[~2010-10-06 9:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1286357720-17351-1-git-send-email-mathias.nyman@nokia.com \
--to=mathias.nyman@nokia.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 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).