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 <penberg@kernel.org>
This commit is contained in:
Pekka Enberg
2011-01-10 22:20:06 +02:00
committed by Will Deacon
parent 133bedc1b8
commit 0bc4cf7872
+2 -3
View File
@@ -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;
}