aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2008-04-28 05:14:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:30 -0400
commit01c194d9278efc15d4785ff205643e9c0bdcef53 (patch)
treedc2aa404a4cb480f58fbc503bcf5826a3a03f597 /drivers/serial
parentfc3f341b5a1a3f26ec8ed74a38234db7d0d1bae1 (diff)
serial 8250: tighten test for using backup timer
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, tighten 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. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Cc: Thomas Koeller <thomas@koeller.dyndns.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 6d0ce64163e5..ea41f2626458 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1868,6 +1868,7 @@ static int serial8250_startup(struct uart_port *port)
1868 } 1868 }
1869 1869
1870 if (is_real_interrupt(up->port.irq)) { 1870 if (is_real_interrupt(up->port.irq)) {
1871 unsigned char iir1;
1871 /* 1872 /*
1872 * Test for UARTs that do not reassert THRE when the 1873 * Test for UARTs that do not reassert THRE when the
1873 * transmitter is idle and the interrupt has already 1874 * transmitter is idle and the interrupt has already
@@ -1881,7 +1882,7 @@ static int serial8250_startup(struct uart_port *port)
1881 wait_for_xmitr(up, UART_LSR_THRE); 1882 wait_for_xmitr(up, UART_LSR_THRE);
1882 serial_out_sync(up, UART_IER, UART_IER_THRI); 1883 serial_out_sync(up, UART_IER, UART_IER_THRI);
1883 udelay(1); /* allow THRE to set */ 1884 udelay(1); /* allow THRE to set */
1884 serial_in(up, UART_IIR); 1885 iir1 = serial_in(up, UART_IIR);
1885 serial_out(up, UART_IER, 0); 1886 serial_out(up, UART_IER, 0);
1886 serial_out_sync(up, UART_IER, UART_IER_THRI); 1887 serial_out_sync(up, UART_IER, UART_IER_THRI);
1887 udelay(1); /* allow a working UART time to re-assert THRE */ 1888 udelay(1); /* allow a working UART time to re-assert THRE */
@@ -1894,7 +1895,7 @@ static int serial8250_startup(struct uart_port *port)
1894 * If the interrupt is not reasserted, setup a timer to 1895 * If the interrupt is not reasserted, setup a timer to
1895 * kick the UART on a regular basis. 1896 * kick the UART on a regular basis.
1896 */ 1897 */
1897 if (iir & UART_IIR_NO_INT) { 1898 if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
1898 pr_debug("ttyS%d - using backup timer\n", port->line); 1899 pr_debug("ttyS%d - using backup timer\n", port->line);
1899 up->timer.function = serial8250_backup_timeout; 1900 up->timer.function = serial8250_backup_timeout;
1900 up->timer.data = (unsigned long)up; 1901 up->timer.data = (unsigned long)up;