cadence_uart: Flush queued characters on reset
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Wed, 3 Apr 2013 04:52:21 +0000 (14:52 +1000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 5 Apr 2013 16:03:01 +0000 (17:03 +0100)
Reset can be used to empty the rx-fifo. As the fifo full condition is
used to return false from can_receive, queued rx data should be flushed
on reset accordingly.

Cc: Wendy Liang <jliang@xilinx.com>
Cc: Jason Wu <huanyu@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reported-by: Jason Wu <huanyu@xilinx.com>
Message-id: 494c1e005e225c915d295ddfd75d992ad2dabc3c.1364964526.git.peter.crosthwaite@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/cadence_uart.c

index 5426f1001896eecbd58ddbd167594bfd95fc9189..421ec998d69962c5ab9218f57c2f2965237f4f72 100644 (file)
@@ -157,6 +157,7 @@ static void uart_rx_reset(UartState *s)
 {
     s->rx_wpos = 0;
     s->rx_count = 0;
+    qemu_chr_accept_input(s->chr);
 
     s->r[R_SR] |= UART_SR_INTR_REMPTY;
     s->r[R_SR] &= ~UART_SR_INTR_RFUL;