From: Alex Williamson <alex.williamson@hp.com>
To: linux-serial <linux-serial@vger.kernel.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Thomas Koeller <thomas@koeller.dyndns.org>
Subject: [PATCH] serial 8250: tighten test for using backup timer
Date: Wed, 19 Mar 2008 10:50:37 -0600 [thread overview]
Message-ID: <1205945437.6881.13.camel@lappy> (raw)
Hi,
Thomas Koeller had reported an issue where a device that had been
making use of the UART_BUG_TXEN code in the 8250 driver was mistakenly
being caught by the backup timer test, causing the device to work
improperly. To fix this, the patch below tightens the test requirements
to enable the backup timer workaround. The backup timer is really meant
to catch UARTs that don't re-assert the THRE interrupt. The expectation
is that they do initially assert THRE. This patch clarifies the test.
Thanks,
Alex
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---
diff -r 2202c155b8c3 drivers/serial/8250.c
--- a/drivers/serial/8250.c Tue Mar 18 21:34:48 2008 -0700
+++ b/drivers/serial/8250.c Wed Mar 19 10:32:40 2008 -0600
@@ -1814,6 +1814,7 @@ static int serial8250_startup(struct uar
}
if (is_real_interrupt(up->port.irq)) {
+ unsigned char iir1;
/*
* Test for UARTs that do not reassert THRE when the
* transmitter is idle and the interrupt has already
@@ -1827,7 +1828,7 @@ static int serial8250_startup(struct uar
wait_for_xmitr(up, UART_LSR_THRE);
serial_out_sync(up, UART_IER, UART_IER_THRI);
udelay(1); /* allow THRE to set */
- serial_in(up, UART_IIR);
+ iir1 = serial_in(up, UART_IIR);
serial_out(up, UART_IER, 0);
serial_out_sync(up, UART_IER, UART_IER_THRI);
udelay(1); /* allow a working UART time to re-assert THRE */
@@ -1840,7 +1841,7 @@ static int serial8250_startup(struct uar
* If the interrupt is not reasserted, setup a timer to
* kick the UART on a regular basis.
*/
- if (iir & UART_IIR_NO_INT) {
+ if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
pr_debug("ttyS%d - using backup timer\n", port->line);
up->timer.function = serial8250_backup_timeout;
up->timer.data = (unsigned long)up;
next reply other threads:[~2008-03-19 21:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-19 16:50 Alex Williamson [this message]
2008-08-05 11:44 ` [PATCH] serial 8250: tighten test for using backup timer Will Newton
2008-08-05 20:06 ` Alex Williamson
2008-08-06 10:53 ` Will Newton
2008-08-11 21:32 ` Andrew Morton
2008-08-12 8:32 ` Will Newton
-- strict thread matches above, loose matches on Subject: below --
2008-08-26 17:45 David Brownell
2008-08-26 17:58 ` Andrew Morton
2008-08-26 18:10 ` Will Newton
2008-09-01 13:36 ` Will Newton
2008-09-01 17:56 ` Andrew Morton
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=1205945437.6881.13.camel@lappy \
--to=alex.williamson@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=thomas@koeller.dyndns.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