WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] ns16550 polling timeout sanity check

To: "Alex Williamson" <alex.williamson@xxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] ns16550 polling timeout sanity check
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Thu, 1 Dec 2005 20:56:33 -0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 01 Dec 2005 20:56:26 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcX2mH8rppLtw7N1RliDCHs5VIwWpQAISZ7Q
Thread-topic: [Xen-devel] ns16550 polling timeout sanity check
Minor point, but please can you put [PATCH] in the subject line of posts
containing patches.

Thanks,
Ian

> Hi Keir,
> 
>    Here's a small sanity check fix for the recently added 
> ns16550 polling support.  If a device has a 1 byte tx fifo 
> it's not hard for the integer math to end up with a 0 
> timeout.  Default to a 1ms timeout if this happens.  Thanks,
> 
>       Alex
> 
> Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
> ---
> 
> diff -r f5b119533cc8 xen/drivers/char/ns16550.c
> --- a/xen/drivers/char/ns16550.c      Thu Dec  1 14:22:22 2005
> +++ b/xen/drivers/char/ns16550.c      Thu Dec  1 09:28:48 2005
> @@ -212,6 +212,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;
> +        if (!uart->timeout_ms)
> +            uart->timeout_ms = 1;
>          init_ac_timer(&uart->timer, ns16550_poll, port, 0);
>          set_ac_timer(&uart->timer, NOW() + 
> MILLISECS(uart->timeout_ms));
>      }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 

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

<Prev in Thread] Current Thread [Next in Thread>