]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools, 8250: Don't set the UART_LSR_OE bit
authorPekka Enberg <penberg@kernel.org>
Thu, 24 Mar 2011 16:56:02 +0000 (18:56 +0200)
committerPekka Enberg <penberg@kernel.org>
Thu, 24 Mar 2011 16:56:02 +0000 (18:56 +0200)
User input is buffered anyway, so it's pointless to set the UART_LSR_OE bit.
Instead, wait for the guest kernel to consume the current input and send a new
character when the guest is ready.

This fixes the following warnings in guest kernels:

[  207.485000] ttyS0: 1 input overrun(s)

Reported-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/8250-serial.c

index 7aea383378f02c12a98bc36a764defd161ce65a5..232f6e86eb8ce1e067cf859a17d680244d4fc495 100644 (file)
@@ -77,6 +77,9 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev)
 {
        int c;
 
+       if (dev->lsr & UART_LSR_DR)
+               return;
+
        if (!is_readable(fileno(stdin)))
                return;
 
@@ -84,9 +87,6 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev)
        if (c < 0)
                return;
 
-       if (dev->lsr & UART_LSR_DR)
-               dev->lsr        |= UART_LSR_OE;
-
        dev->rbr        = c;
        dev->lsr        |= UART_LSR_DR;
 }