From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjEd-0000sW-38 for qemu-devel@nongnu.org; Thu, 03 Oct 2013 09:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRjEW-0000yf-WA for qemu-devel@nongnu.org; Thu, 03 Oct 2013 09:46:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRjEW-0000xC-O3 for qemu-devel@nongnu.org; Thu, 03 Oct 2013 09:46:24 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r93DkNql005000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Oct 2013 09:46:23 -0400 From: Paolo Bonzini Date: Thu, 3 Oct 2013 15:46:13 +0200 Message-Id: <1380807975-13266-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1380807975-13266-1-git-send-email-pbonzini@redhat.com> References: <1380807975-13266-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