From 0bc4cf78724592b5139b514b189d8bdb3bc9adf5 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 10 Jan 2011 22:20:06 +0200 Subject: [PATCH] kvm,8250: Fix ->counter clearing We need to reset the counter to zero before we inject an interrupt to the guest. Signed-off-by: Pekka Enberg --- 8250-serial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/8250-serial.c b/8250-serial.c index 834c523..16910e3 100644 --- a/8250-serial.c +++ b/8250-serial.c @@ -105,6 +105,7 @@ void serial8250__interrupt(struct kvm *self) /* Only send an IRQ if there's work to do. */ if (new_iir) { + dev->counter = 0; dev->iir = new_iir; kvm__irq_line(self, dev->irq, 0); kvm__irq_line(self, dev->irq, 1); @@ -164,10 +165,8 @@ static bool serial8250_out(struct kvm *self, uint16_t port, void *data, int size } fflush(stdout); - if (dev->counter++ > 10) { + if (dev->counter++ > 10) dev->iir = UART_IIR_NO_INT; - dev->counter = 0; - } break; }