qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: imammedo@redhat.com, qemu-stable@nongnu.org, andrey@xdel.ru,
	dgilbert@redhat.com, batuzovk@ispras.ru
Subject: [Qemu-devel] [PATCH 3/3] serial: do not trigger THR interrupt after writing to IER
Date: Thu, 11 Dec 2014 19:18:51 +0100	[thread overview]
Message-ID: <1418321931-12648-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1418321931-12648-1-git-send-email-pbonzini@redhat.com>

This is responsible for failure of migration from 2.2 to 2.1, because
thr_ipending is always one in practice.  Calling serial_update_irq is
the right thing to do indeed, because writing to IER could cause an
interrupt to appear.  However, there is no reason to set thr_ipending
again.

This was already reported in 2010.  See this quote from
https://lists.gnu.org/archive/html/qemu-devel/2010-03/msg01914.html:

> The commit in r1049 (serial interrupt fix (Hampa Hug)) prevents
> booting Digital Research DOSPlus. Following patch partially reverts
> that commit and makes DOSPlus booting in QEMU again.

Bochs does not check LSR_THRE in IER, and the log message in r1049 doesn't
explain why the change was made in the first place.

This does not change the migration format, so 2.2.0 -> 2.1 will remain
broken but we can fix 2.2.1 -> 2.1 without breaking 2.2.1 <-> 2.2.0.

Cc: qemu-stable@nongnu.org
Reported-by: Igor Mammedov <imammedo@redhat.com>
Reported-by: Roy Tam <roytam@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/char/serial.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/char/serial.c b/hw/char/serial.c
index f35fa42..2b7f4f5 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -348,10 +348,7 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,
                      s->poll_msl = 0;
                 }
             }
-            if (s->lsr & UART_LSR_THRE) {
-                s->thr_ipending = 1;
-                serial_update_irq(s);
-            }
+            serial_update_irq(s);
         }
         break;
     case 2:
-- 
1.8.3.1

      parent reply	other threads:[~2014-12-11 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 18:18 [Qemu-devel] [PATCH 0/3] serial: fixes for migration Paolo Bonzini
2014-12-11 18:18 ` [Qemu-devel] [PATCH 1/3] serial: clean up THRE/TEMT handling Paolo Bonzini
2014-12-11 18:18 ` [Qemu-devel] [PATCH 2/3] serial: update LSR on enabling/disabling FIFOs Paolo Bonzini
2014-12-11 18:18 ` Paolo Bonzini [this message]

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=1418321931-12648-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=andrey@xdel.ru \
    --cc=batuzovk@ispras.ru \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).