All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Juergen Lock <nox@jelal.kn-bremen.de>
Cc: "Olivier Cochard-Labbé" <olivier@cochard.me>,
	"freebsd-current@FreeBSD.org" <freebsd-current@FreeBSD.org>,
	"Jan Kiszka" <jan.kiszka@web.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
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	[thread overview]
Message-ID: <alpine.DEB.2.00.0909141757090.18876@kaball-desktop> (raw)
In-Reply-To: <20090912165222.GA38048@triton8.kn-bremen.de>

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 <stefano.stabellini@eu.citrix.com>

> 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 <nox@jelal.kn-bremen.de>
> 
> 

  parent reply	other threads:[~2009-09-14 16:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 21:35 [Qemu-devel] qemu serial: lost tx irqs (affectig FreeBSD's new uart(4) driver) Juergen Lock
2009-09-12 11:20 ` [Qemu-devel] " Olivier Cochard-Labbé
2009-09-12 12:26 ` Jan Kiszka
2009-09-12 16:52   ` Juergen Lock
2009-09-12 17:00     ` Jan Kiszka
2009-09-14 16:59     ` Stefano Stabellini [this message]
2009-09-16 19:01     ` Aurelien Jarno
2009-09-23 18:47       ` Juergen Lock
2009-09-24 16:20         ` Aurelien Jarno
2009-09-24 21:26           ` Juergen Lock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0909141757090.18876@kaball-desktop \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=freebsd-current@FreeBSD.org \
    --cc=jan.kiszka@web.de \
    --cc=nox@jelal.kn-bremen.de \
    --cc=olivier@cochard.me \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.