qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: qemu serial: lost tx irqs (affectig FreeBSD's new u


From: Stefano Stabellini
Subject: Re: [Qemu-devel] Re: qemu serial: lost tx irqs (affectig FreeBSD's new uart(4) driver)
Date: Mon, 14 Sep 2009 17:59:28 +0100
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Sat, 12 Sep 2009, Juergen Lock wrote:
> 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.  And ideed, fixing that
> seems to get my FreeBSD 8 guest back to working order as well:

Good spot!
The fix also seems correct to me.

Acked-by: Stefano Stabellini <address@hidden>

> Index: qemu/hw/serial.c
> @@ -196,12 +195,10 @@ static void serial_update_irq(SerialStat
>           * 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)) {
> 
>  Signed-off-by: Juergen Lock <address@hidden>
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]