aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-11-25 11:52:38 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-12-16 15:59:07 +0000
commit36cdc8b3b87b8a42933b1987ad00cbe1c1a6f6d8 (patch)
treeaa0100dc336eb0bfd2037415238f9aa77ed3cf6a /hw/intc
parentf4c636b0c2f53531e16e018b6e096d26b5809dfd (diff)
downloadqemu-36cdc8b3b87b8a42933b1987ad00cbe1c1a6f6d8.zip
qemu-36cdc8b3b87b8a42933b1987ad00cbe1c1a6f6d8.tar.gz
qemu-36cdc8b3b87b8a42933b1987ad00cbe1c1a6f6d8.tar.bz2
hw/intc/xics: Reset TYPE_ICS objects with device_cold_reset()
The realize method for the TYPE_ICS class uses qemu_register_reset() to register a reset handler, as a workaround for the fact that currently objects which directly inherit from TYPE_DEVICE don't get automatically reset. However, the reset function directly calls ics_reset(), which is the function that implements the legacy reset method. This means that only the parent class's data gets reset, and a subclass which also needs to handle reset, like TYPE_PHB3_MSI, has to register its own reset function. Make the TYPE_ICS reset function call device_cold_reset() instead: this will handle reset for both the parent class and the subclass, and will work whether the classes are using legacy reset or 3-phase reset. This allows us to remove the reset function that the subclass currently has to set up. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20221125115240.3005559-6-peter.maydell@linaro.org
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/xics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index dcd021a..dd13046 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -593,7 +593,7 @@ static void ics_reset(DeviceState *dev)
static void ics_reset_handler(void *dev)
{
- ics_reset(dev);
+ device_cold_reset(dev);
}
static void ics_realize(DeviceState *dev, Error **errp)