From: Paolo Bonzini <pbonzini@redhat.com>
To: "Cole Robinson" <crobinso@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] 2.0 regression: loadvm assertion with ehci + tablet
Date: Mon, 31 Mar 2014 20:18:44 +0200 [thread overview]
Message-ID: <5339B184.1090503@redhat.com> (raw)
In-Reply-To: <5339B077.4040707@redhat.com>
Il 31/03/2014 20:14, Cole Robinson ha scritto:
> irq_state is cleared before pci_device_deassert_intx. But tries to clear all
> irqs via pci_irq_handler, but that function will exit without taking any
> action if the requested irq level matches what we already track in irq_state.
> Since irq_state is 0, pci_device_deassert_intx is basically a no-op. Any
> interrupts with level=1 will not be cleared, which is the case with the usb
> tablet after usb_detach.
Thanks for the analysis. It's my bug indeed.
> This fixes things for me, but I have no idea if it's the proper fix:
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 8f722dd..1912dfb 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -189,9 +189,9 @@ static void pci_do_device_reset(PCIDevice *dev)
> {
> int r;
>
> + pci_device_deassert_intx(dev);
> dev->irq_state = 0;
> pci_update_irq_status(dev);
> - pci_device_deassert_intx(dev);
> /* Clear all writable bits */
> pci_word_test_and_clear_mask(dev->config + PCI_COMMAND,
> pci_get_word(dev->wmask + PCI_COMMAND) |
Yes, the patch is fine. Even better, dev->irq_state = 0 could become an
assertion too, and the call to pci_update_irq_status is not necessary at
all.
Paolo
prev parent reply other threads:[~2014-03-31 18:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-30 20:27 [Qemu-devel] 2.0 regression: loadvm assertion with ehci + tablet Cole Robinson
2014-03-30 20:48 ` Michael S. Tsirkin
2014-03-31 17:04 ` Cole Robinson
2014-03-30 22:25 ` Andreas Färber
2014-03-31 18:14 ` Cole Robinson
2014-03-31 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=5339B184.1090503@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=crobinso@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--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.