From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv83M-0006l8-EQ for qemu-devel@nongnu.org; Mon, 23 Dec 2013 11:08:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv83C-0000xv-VS for qemu-devel@nongnu.org; Mon, 23 Dec 2013 11:08:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv83C-0000xj-NK for qemu-devel@nongnu.org; Mon, 23 Dec 2013 11:08:14 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBNG8Enr032077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Dec 2013 11:08:14 -0500 Date: Mon, 23 Dec 2013 18:12:10 +0200 From: "Michael S. Tsirkin" Message-ID: <1387815007-1272-15-git-send-email-mst@redhat.com> References: <1387815007-1272-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1387815007-1272-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 14/19] pci: clean up resetting of IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini From: Paolo Bonzini 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 Signed-off-by: Michael S. Tsirkin --- hw/pci/pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 83ea0a0..131e599 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -217,15 +217,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; -- MST