Mailing List Archive

Avoid ns16550 poll timeout underflow.
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 106f258edf97d35c11f80717f40cac482583ddf6
# Parent 43a1f899e302b813616b2467380537fecc92a3a7
Avoid ns16550 poll timeout underflow.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Keir Fraser <keir@xensource.com>

diff -r 43a1f899e302 -r 106f258edf97 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c Fri Dec 2 08:54:09 2005
+++ b/xen/drivers/char/ns16550.c Fri Dec 2 10:05:49 2005
@@ -211,7 +211,8 @@
{
/* Polled mode. Calculate time to fill RX FIFO and/or empty TX FIFO. */
bits = uart->data_bits + uart->stop_bits + !!uart->parity;
- uart->timeout_ms = (bits * port->tx_fifo_size * 1000) / uart->baud;
+ uart->timeout_ms = max_t(
+ unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
init_ac_timer(&uart->timer, ns16550_poll, port, 0);
set_ac_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog