Avoid ns16550 poll timeout underflow.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-12-02 11:05:49 +01:00
1 parent 369754a8f6
commit ac70d56946
1 file changed
+2 -1
+2 -1
View File
@@ -211,7 +211,8 @@ static void ns16550_init_postirq(struct serial_port *port)
{
/* 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));
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.