OSDN Git Service

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 b499bca..a421d1e 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;
         }
     }