From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Voyg1-0005x8-5O for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:55:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Voyfs-0000cK-B1 for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:54:53 -0500 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:32794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Voyfs-0000cB-0h for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:54:44 -0500 Received: by mail-ea0-f171.google.com with SMTP id h10so422790eak.16 for ; Fri, 06 Dec 2013 08:54:43 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 6 Dec 2013 17:54:25 +0100 Message-Id: <1386348867-25038-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1386348867-25038-1-git-send-email-pbonzini@redhat.com> References: <1386348867-25038-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] pci: clean up resetting of IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com pci_device_reset will deassert the INTX pins, and this will make the irq_count array all-zeroes. Check that this is the case, and remove the existing loop which might even unsync irq_count and irq_state. Signed-off-by: Paolo Bonzini --- hw/pci/pci.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index ac3244b..0efc544 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -215,15 +215,16 @@ static int pcibus_reset(BusState *qbus) PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus); int i; - for (i = 0; i < bus->nirq; i++) { - bus->irq_count[i] = 0; - } for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) { if (bus->devices[i]) { pci_device_reset(bus->devices[i]); } } + for (i = 0; i < bus->nirq; i++) { + assert(bus->irq_count[i] == 0); + } + /* topology traverse is done by pci_bus_reset(). Tell qbus/qdev walker not to traverse the tree */ return 1; -- 1.7.1