From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnEqE-0002JB-S5 for qemu-devel@nongnu.org; Mon, 14 Sep 2009 12:55:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnEqA-0002Fw-A3 for qemu-devel@nongnu.org; Mon, 14 Sep 2009 12:55:50 -0400 Received: from [199.232.76.173] (port=42380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnEqA-0002Fd-10 for qemu-devel@nongnu.org; Mon, 14 Sep 2009 12:55:46 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:43187 helo=SMTP.EU.CITRIX.COM) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnEq9-000323-Ay for qemu-devel@nongnu.org; Mon, 14 Sep 2009 12:55:45 -0400 Date: Mon, 14 Sep 2009 17:59:28 +0100 From: Stefano Stabellini Subject: Re: [Qemu-devel] Re: qemu serial: lost tx irqs (affectig FreeBSD's new uart(4) driver) In-Reply-To: <20090912165222.GA38048@triton8.kn-bremen.de> Message-ID: References: <20090911213508.GA97446@triton8.kn-bremen.de> <4AAB938B.9080004@web.de> <20090912165222.GA38048@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juergen Lock Cc: =?ISO-8859-15?Q?Olivier_Cochard-Labb=E9?= , "freebsd-current@FreeBSD.org" , Jan Kiszka , "qemu-devel@nongnu.org" 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 > 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 > >