]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
serial: clear LSR.TEMT when populating the TSR
authorAnthony Liguori <aliguori@us.ibm.com>
Sun, 1 Apr 2012 19:18:30 +0000 (14:18 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 2 Apr 2012 14:43:17 +0000 (09:43 -0500)
We never actually clear the TEMT (transmit sending register empty) flag when
populating the TSR.  We set the flag, but since it's never cleared, setting it
is sort of pointless..

I found this with a unit test case.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/serial.c

index b499bca659a3917c5e9af24e051e57038028011a..a421d1e7bc7c3d55c516b501292b808e141f0ec1 100644 (file)
@@ -332,6 +332,7 @@ static void serial_xmit(void *opaque)
         } else {
             s->tsr = s->thr;
             s->lsr |= UART_LSR_THRE;
+            s->lsr &= ~UART_LSR_TEMT;
         }
     }