From 011b2955110a5356d91d3377a10d23635c78517a Mon Sep 17 00:00:00 2001 From: Juergen Lock Date: Sat, 12 Sep 2009 18:52:22 +0200 Subject: [PATCH] qemu serial: lost tx irqs (affecting FreeBSD's new uart(4) driver) Well one problem seems to be the rx condition, ... if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR)) is not enough to trigger an irq, yet still causes the following conditions not to be checked anymore at all. Signed-off-by: Juergen Lock Acked-by: Jan Kiszka Acked-by: Stefano Stabellini Signed-off-by: Aurelien Jarno --- hw/serial.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index d70504bb06c..498f4a0a167 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -195,12 +195,10 @@ static void serial_update_irq(SerialState *s) * this is not in the specification but is observed on existing * hardware. */ tmp_iir = UART_IIR_CTI; - } else if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR)) { - if (!(s->fcr & UART_FCR_FE)) { - tmp_iir = UART_IIR_RDI; - } else if (s->recv_fifo.count >= s->recv_fifo.itl) { - tmp_iir = UART_IIR_RDI; - } + } else if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR) && + (!(s->fcr & UART_FCR_FE) || + s->recv_fifo.count >= s->recv_fifo.itl)) { + tmp_iir = UART_IIR_RDI; } else if ((s->ier & UART_IER_THRI) && s->thr_ipending) { tmp_iir = UART_IIR_THRI; } else if ((s->ier & UART_IER_MSI) && (s->msr & UART_MSR_ANY_DELTA)) { -- 2.39.5