[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/36] pci: Switch bus reset to 3-phase-reset
From: |
Peter Maydell |
Subject: |
[PULL 02/36] pci: Switch bus reset to 3-phase-reset |
Date: |
Fri, 2 Feb 2024 15:36:03 +0000 |
Switch the PCI bus from using BusClass::reset to the Resettable
interface.
This has no behavioural change, because the BusClass code to support
subclasses that use the legacy BusClass::reset will call that method
in the hold phase of 3-phase reset.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-id: 20240119163512.3810301-2-peter.maydell@linaro.org
---
hw/pci/pci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 76080af580d..05c2e46bda5 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -64,7 +64,7 @@ bool pci_available = true;
static char *pcibus_get_dev_path(DeviceState *dev);
static char *pcibus_get_fw_dev_path(DeviceState *dev);
-static void pcibus_reset(BusState *qbus);
+static void pcibus_reset_hold(Object *obj);
static bool pcie_has_upstream_port(PCIDevice *dev);
static Property pci_props[] = {
@@ -202,13 +202,15 @@ static void pci_bus_class_init(ObjectClass *klass, void
*data)
{
BusClass *k = BUS_CLASS(klass);
PCIBusClass *pbc = PCI_BUS_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->print_dev = pcibus_dev_print;
k->get_dev_path = pcibus_get_dev_path;
k->get_fw_dev_path = pcibus_get_fw_dev_path;
k->realize = pci_bus_realize;
k->unrealize = pci_bus_unrealize;
- k->reset = pcibus_reset;
+
+ rc->phases.hold = pcibus_reset_hold;
pbc->bus_num = pcibus_num;
pbc->numa_node = pcibus_numa_node;
@@ -424,9 +426,9 @@ void pci_device_reset(PCIDevice *dev)
* Called via bus_cold_reset on RST# assert, after the devices
* have been reset device_cold_reset-ed already.
*/
-static void pcibus_reset(BusState *qbus)
+static void pcibus_reset_hold(Object *obj)
{
- PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus);
+ PCIBus *bus = PCI_BUS(obj);
int i;
for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
--
2.34.1
- [PULL 00/36] target-arm queue, Peter Maydell, 2024/02/02
- [PULL 01/36] target/arm: fix exception syndrome for AArch32 bkpt insn, Peter Maydell, 2024/02/02
- [PULL 02/36] pci: Switch bus reset to 3-phase-reset,
Peter Maydell <=
- [PULL 03/36] vmbus: Switch bus reset to 3-phase-reset, Peter Maydell, 2024/02/02
- [PULL 04/36] adb: Switch bus reset to 3-phase-reset, Peter Maydell, 2024/02/02
- [PULL 05/36] hw/s390x/css-bridge: switch virtual-css bus to 3-phase-reset, Peter Maydell, 2024/02/02
- [PULL 06/36] hw/core: Remove transitional infrastructure from BusClass, Peter Maydell, 2024/02/02
- [PULL 09/36] target/arm: Add ID_AA64ZFR0_EL1.B16B16 to the exposed-to-userspace set, Peter Maydell, 2024/02/02
- [PULL 08/36] qemu-options.hx: Improve -serial option documentation, Peter Maydell, 2024/02/02
- [PULL 10/36] tests/qtest/xlnx-versal-trng-test.c: Drop use of variable length array, Peter Maydell, 2024/02/02
- [PULL 07/36] system/vl.c: Fix handling of '-serial none -serial something', Peter Maydell, 2024/02/02
- [PULL 11/36] target/arm: Reinstate "vfp" property on AArch32 CPUs, Peter Maydell, 2024/02/02
- [PULL 13/36] hw/arm/exynos: Add missing QOM parent for CPU cores, Peter Maydell, 2024/02/02