|
|
298366 |
From 07873f45017c04994496d8dc3f7acb60358bba49 Mon Sep 17 00:00:00 2001
|
|
|
9e0a86 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9e0a86 |
Date: Thu, 2 May 2013 11:38:37 +0200
|
|
|
9e0a86 |
Subject: [PATCH] pci: do not export pci_bus_reset
|
|
|
9e0a86 |
|
|
|
9e0a86 |
qbus_reset_all can be used instead. There is no semantic change
|
|
|
9e0a86 |
because pcibus_reset returns 1 and takes care of the device
|
|
|
9e0a86 |
tree traversal.
|
|
|
9e0a86 |
|
|
|
9e0a86 |
This will be necessary once the traversal is done always in
|
|
|
9e0a86 |
qbus_reset_all *before* invoking pcibus_reset itself.
|
|
|
9e0a86 |
|
|
|
9e0a86 |
Tested-by: Claudio Bley <cbley@av-test.de>
|
|
|
9e0a86 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9e0a86 |
---
|
|
|
9e0a86 |
hw/pci/pci.c | 8 ++------
|
|
|
9e0a86 |
hw/pci/pci_bridge.c | 2 +-
|
|
|
9e0a86 |
include/hw/pci/pci.h | 1 -
|
|
|
9e0a86 |
3 files changed, 3 insertions(+), 8 deletions(-)
|
|
|
9e0a86 |
|
|
|
9e0a86 |
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
|
|
|
9e0a86 |
index 4c004f5..0389375 100644
|
|
|
9e0a86 |
--- a/hw/pci/pci.c
|
|
|
9e0a86 |
+++ b/hw/pci/pci.c
|
|
|
9e0a86 |
@@ -210,8 +210,9 @@ void pci_device_reset(PCIDevice *dev)
|
|
|
9e0a86 |
* Trigger pci bus reset under a given bus.
|
|
|
9e0a86 |
* To be called on RST# assert.
|
|
|
9e0a86 |
*/
|
|
|
9e0a86 |
-void pci_bus_reset(PCIBus *bus)
|
|
|
9e0a86 |
+static int pcibus_reset(BusState *qbus)
|
|
|
9e0a86 |
{
|
|
|
9e0a86 |
+ PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus);
|
|
|
9e0a86 |
int i;
|
|
|
9e0a86 |
|
|
|
9e0a86 |
for (i = 0; i < bus->nirq; i++) {
|
|
|
9e0a86 |
@@ -222,11 +223,6 @@ void pci_bus_reset(PCIBus *bus)
|
|
|
9e0a86 |
pci_device_reset(bus->devices[i]);
|
|
|
9e0a86 |
}
|
|
|
9e0a86 |
}
|
|
|
9e0a86 |
-}
|
|
|
9e0a86 |
-
|
|
|
9e0a86 |
-static int pcibus_reset(BusState *qbus)
|
|
|
9e0a86 |
-{
|
|
|
9e0a86 |
- pci_bus_reset(DO_UPCAST(PCIBus, qbus, qbus));
|
|
|
9e0a86 |
|
|
|
9e0a86 |
/* topology traverse is done by pci_bus_reset().
|
|
|
9e0a86 |
Tell qbus/qdev walker not to traverse the tree */
|
|
|
9e0a86 |
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
|
|
|
9e0a86 |
index a90671d..5d0e5ff 100644
|
|
|
9e0a86 |
--- a/hw/pci/pci_bridge.c
|
|
|
9e0a86 |
+++ b/hw/pci/pci_bridge.c
|
|
|
9e0a86 |
@@ -268,7 +268,7 @@ void pci_bridge_write_config(PCIDevice *d,
|
|
|
9e0a86 |
newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL);
|
|
|
9e0a86 |
if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) {
|
|
|
9e0a86 |
/* Trigger hot reset on 0->1 transition. */
|
|
|
9e0a86 |
- pci_bus_reset(&s->sec_bus);
|
|
|
9e0a86 |
+ qbus_reset_all(&s->sec_bus.qbus);
|
|
|
9e0a86 |
}
|
|
|
9e0a86 |
}
|
|
|
9e0a86 |
|
|
|
9e0a86 |
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
|
|
|
9e0a86 |
index ccec2ba..32f1419 100644
|
|
|
9e0a86 |
--- a/include/hw/pci/pci.h
|
|
|
9e0a86 |
+++ b/include/hw/pci/pci.h
|
|
|
9e0a86 |
@@ -376,7 +376,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus);
|
|
|
9e0a86 |
void pci_device_set_intx_routing_notifier(PCIDevice *dev,
|
|
|
9e0a86 |
PCIINTxRoutingNotifier notifier);
|
|
|
9e0a86 |
void pci_device_reset(PCIDevice *dev);
|
|
|
9e0a86 |
-void pci_bus_reset(PCIBus *bus);
|
|
|
9e0a86 |
|
|
|
9e0a86 |
PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
|
|
|
9e0a86 |
const char *default_model,
|