From: Paolo Bonzini <pbonzini@redhat.com>
To: Cole Robinson <crobinso@redhat.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.0] pci: Fix clearing IRQs on reset
Date: Mon, 31 Mar 2014 20:32:29 +0200 [thread overview]
Message-ID: <5339B4BD.50706@redhat.com> (raw)
In-Reply-To: <7da1ad94ce027183b4049c2de370cb191b0073c1.1396290569.git.crobinso@redhat.com>
Il 31/03/2014 20:31, Cole Robinson ha scritto:
> irq_state is cleared before calling pci_device_deassert_intx, but the
> latter misbehaves if the former isn't accurate. In this case, any raised
> IRQs are not cleared, which hits an assertion in pcibus_reset:
>
> qemu-system-x86_64: hw/pci/pci.c:250: pcibus_reset: Assertion
> `bus->irq_count[i] == 0' failed.
>
> pci_device_deassert_intx should clear irq_state anyways, so add
> an assert.
>
> This fixes migration with usb2 + usb-tablet.
>
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
> hw/pci/pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 8f722dd..2a9f08e 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;
>
> - dev->irq_state = 0;
> - pci_update_irq_status(dev);
> pci_device_deassert_intx(dev);
> + assert(dev->irq_state == 0);
> +
> /* Clear all writable bits */
> pci_word_test_and_clear_mask(dev->config + PCI_COMMAND,
> pci_get_word(dev->wmask + PCI_COMMAND) |
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2014-03-31 18:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 18:31 [Qemu-devel] [PATCH for-2.0] pci: Fix clearing IRQs on reset Cole Robinson
2014-03-31 18:32 ` Paolo Bonzini [this message]
2014-03-31 18:53 ` Michael S. Tsirkin
2014-03-31 19:09 ` Peter Maydell
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=5339B4BD.50706@redhat.com \
--to=pbonzini@redhat.com \
--cc=crobinso@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 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).