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-changelog

[Xen-changelog] [xen-unstable] qemu-dm: Limit transmit retries from virt

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] qemu-dm: Limit transmit retries from virtual UART FIFO.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Dec 2007 06:20:12 -0800
Delivery-date: Thu, 06 Dec 2007 06:20:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1196937670 0
# Node ID 90f02ca762448d7af4106b1552ded64cbea5919a
# Parent  8ba08f2244b29ec2a1436467b4d5dc30e770accb
qemu-dm: Limit transmit retries from virtual UART FIFO.
Signed-off-by: Trolle Selander <trolle.selander@xxxxxxxxx>
---
 tools/ioemu/hw/serial.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -r 8ba08f2244b2 -r 90f02ca76244 tools/ioemu/hw/serial.c
--- a/tools/ioemu/hw/serial.c   Wed Dec 05 17:56:13 2007 +0000
+++ b/tools/ioemu/hw/serial.c   Thu Dec 06 10:41:10 2007 +0000
@@ -96,6 +96,7 @@
 
 #define XMIT_FIFO           0
 #define RECV_FIFO           1
+#define MAX_XMIT_RETRY      4
  
 struct SerialFIFO {
     uint8_t data[UART_FIFO_LENGTH];
@@ -136,7 +137,7 @@ struct SerialState {
 
     struct QEMUTimer *fifo_timeout_timer;
     int timeout_ipending;                   /* timeout interrupt pending state 
*/
-    struct QEMUTimer *fifo_transmit_timer;
+    struct QEMUTimer *transmit_timer;
 
 
     uint64_t char_transmit_time;               /* time to transmit a char in 
ticks*/
@@ -370,15 +371,17 @@ static void serial_xmit(void *opaque) {
 
     if ( qemu_chr_write(s->chr, &s->tsr, 1) != 1 ) {
         s->tsr_retry++;
-        qemu_mod_timer(s->fifo_transmit_timer,  new_xmit_ts + 
s->char_transmit_time );
-        return;
+        if ( s->tsr_retry <= MAX_XMIT_RETRY ) {
+            qemu_mod_timer(s->transmit_timer,  new_xmit_ts + 
s->char_transmit_time );
+            return;
+        }
     }
  
     s->tsr_retry = 0;
     s->last_xmit_ts = qemu_get_clock(vm_clock);
 
-    if ( s->xmit_fifo.count > 0 )
-        qemu_mod_timer(s->fifo_transmit_timer, s->last_xmit_ts + 
s->char_transmit_time );
+    if ( !(s->lsr & UART_LSR_THRE) )
+        qemu_mod_timer(s->transmit_timer, s->last_xmit_ts + 
s->char_transmit_time );
 
     if ( s->lsr & UART_LSR_THRE ) {
         s->lsr |= UART_LSR_TEMT;
@@ -752,7 +755,7 @@ SerialState *serial_init(SetIRQFunc *set
     fifo_clear(s,XMIT_FIFO);
     s->last_xmit_ts = qemu_get_clock(vm_clock);
     s->fifo_timeout_timer = qemu_new_timer(vm_clock, ( QEMUTimerCB *) 
fifo_timeout_int, s);
-    s->fifo_transmit_timer = qemu_new_timer(vm_clock, ( QEMUTimerCB *) 
serial_xmit, s);
+    s->transmit_timer = qemu_new_timer(vm_clock, ( QEMUTimerCB *) serial_xmit, 
s);
 
     register_savevm("serial", base, 2, serial_save, serial_load, s);
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] qemu-dm: Limit transmit retries from virtual UART FIFO., Xen patchbot-unstable <=