* [Qemu-devel] [PATCH] pci: clean up resetting of IRQs
@ 2013-01-10 14:41 Paolo Bonzini
0 siblings, 0 replies; only message in thread
From: Paolo Bonzini @ 2013-01-10 14:41 UTC (permalink / raw)
To: qemu-devel; +Cc: mst
A PCI bus 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 <pbonzini@redhat.com>
---
hw/pci/pci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 94840c4..d6c63ff 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -213,14 +213,14 @@ void pci_bus_reset(PCIBus *bus)
{
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);
+ }
}
static int pcibus_reset(BusState *qbus)
--
1.8.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-10 14:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 14:41 [Qemu-devel] [PATCH] pci: clean up resetting of IRQs Paolo Bonzini
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).