qemu-devel
[Top][All Lists]
Advanced

[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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]