[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/15] qdev: switch reset to post-order
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 10/15] qdev: switch reset to post-order |
Date: |
Mon, 17 Dec 2012 17:24:45 +0100 |
Post-order is the only sensible direction for the reset signals. For example,
suppose pre-order is used and the parent has some data structures that cache
children state (for example a list of active requests). When the reset
method is invoked on the parent, these caches cannot be left in a consistent
state, nor asserted to be in a consistent state.
If post-order is used, on the other hand, these will be in a known state
when the reset method is invoked on the parent.
I checked the existing bus-reset implementation and they are all fine with
post-order. USB doesn't use qdev reset, but it should be fine with post-order
too.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/qdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 457f7bf..833d571 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -227,12 +227,12 @@ static int qbus_reset_one(BusState *bus, void *opaque)
void qdev_reset_all(DeviceState *dev)
{
- qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
+ qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
}
void qbus_reset_all(BusState *bus)
{
- qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
+ qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
}
void qbus_reset_all_fn(void *opaque)
--
1.8.0.2
- Re: [Qemu-devel] [PATCH 01/15] qdev: do not reset a device until the parent has been initialized, (continued)
[Qemu-devel] [PATCH 03/15] pci: clean up resetting of IRQs, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 05/15] virtio-s390: add a reset function to virtio-s390 devices, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 06/15] qdev: add qbus_reset_all, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 04/15] virtio-pci: reset device before PCI layer, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 08/15] lsi: use qbus_reset_all to reset SCSI bus, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 07/15] pci: do not export pci_bus_reset, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 09/15] qdev: allow both pre- and post-order vists in qdev walking functions, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 10/15] qdev: switch reset to post-order,
Paolo Bonzini <=
[Qemu-devel] [PATCH 11/15] qdev: remove device_reset, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 15/15] virtio-serial: do not perform bus reset by hand, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 14/15] virtio-s390: reset all qbuses too when writing to the status field, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 13/15] virtio-pci: reset all qbuses too when writing to the status field, Paolo Bonzini, 2012/12/17
[Qemu-devel] [PATCH 12/15] qdev: document reset semantics, Paolo Bonzini, 2012/12/17