ia64/xen-unstable

changeset 8175:106f258edf97

Avoid ns16550 poll timeout underflow.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Dec 02 11:05:49 2005 +0100 (2005-12-02)
parents 43a1f899e302
children 1e89d78f21c5
files xen/drivers/char/ns16550.c
line diff
     1.1 --- a/xen/drivers/char/ns16550.c	Fri Dec 02 09:54:09 2005 +0100
     1.2 +++ b/xen/drivers/char/ns16550.c	Fri Dec 02 11:05:49 2005 +0100
     1.3 @@ -211,7 +211,8 @@ static void ns16550_init_postirq(struct 
     1.4      {
     1.5          /* Polled mode. Calculate time to fill RX FIFO and/or empty TX FIFO. */
     1.6          bits = uart->data_bits + uart->stop_bits + !!uart->parity;
     1.7 -        uart->timeout_ms = (bits * port->tx_fifo_size * 1000) / uart->baud;
     1.8 +        uart->timeout_ms = max_t(
     1.9 +            unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
    1.10          init_ac_timer(&uart->timer, ns16550_poll, port, 0);
    1.11          set_ac_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
    1.12      }