]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm,8250: Fix ->counter clearing
authorPekka Enberg <penberg@kernel.org>
Mon, 10 Jan 2011 20:20:06 +0000 (22:20 +0200)
committerPekka Enberg <penberg@kernel.org>
Tue, 11 Jan 2011 14:49:50 +0000 (16:49 +0200)
We need to reset the counter to zero before we inject an interrupt to the
guest.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/8250-serial.c

index 834c523f4cffc87aa8398d17f8334da6ede3950f..16910e35dc169cf71f01016da5f40b7161d3e0a1 100644 (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;
                }