OSDN Git Service

hw/ppc/spapr_pci.c: Use device_cold_reset() rather than device_legacy_reset()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 14 Oct 2022 14:28:41 +0000 (15:28 +0100)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 17 Oct 2022 19:15:10 +0000 (16:15 -0300)
In spapr_phb_children_reset() we call device_legacy_reset() to reset any
QOM children of the SPAPR PCI host bridge device. This will not reset
any qbus such a child might own. Switch to device_cold_reset(), which will
reset both the device and its buses. (If the child has no qbuses then
there will be no change in behaviour.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20221014142841.2092784-1-peter.maydell@linaro.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
hw/ppc/spapr_pci.c

index 57c8a4f..7b7618d 100644 (file)
@@ -2045,7 +2045,7 @@ static int spapr_phb_children_reset(Object *child, void *opaque)
     DeviceState *dev = (DeviceState *) object_dynamic_cast(child, TYPE_DEVICE);
 
     if (dev) {
-        device_legacy_reset(dev);
+        device_cold_reset(dev);
     }
 
     return 0;