]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/8250.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / serial / 8250.c
index ae04cc7177d919d555a83569c092f23e4be97605..39aca22e57a843e821e777fb1d1edf394f1840c8 100644 (file)
@@ -1912,14 +1912,22 @@ static int serial8250_startup(struct uart_port *port)
                 * kick the UART on a regular basis.
                 */
                if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
+                       up->bugs |= UART_BUG_THRE;
                        pr_debug("ttyS%d - using backup timer\n", port->line);
-                       up->timer.function = serial8250_backup_timeout;
-                       up->timer.data = (unsigned long)up;
-                       mod_timer(&up->timer, jiffies +
-                               poll_timeout(up->port.timeout) + HZ / 5);
                }
        }
 
+       /*
+        * The above check will only give an accurate result the first time
+        * the port is opened so this value needs to be preserved.
+        */
+       if (up->bugs & UART_BUG_THRE) {
+               up->timer.function = serial8250_backup_timeout;
+               up->timer.data = (unsigned long)up;
+               mod_timer(&up->timer, jiffies +
+                         poll_timeout(up->port.timeout) + HZ / 5);
+       }
+
        /*
         * If the "interrupt" for this port doesn't correspond with any
         * hardware interrupt, we use a timer-based system.  The original