Skip to content

qdev: switch reset to post-order

Paolo Bonzini qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3pci: do not export pci_bus_resethw/pci/pci.c hw/pci/pci_bridge.c include/hw/pci/pci.h+3 -80 replies
2/3qdev: allow both pre- and post-order vists in qdev walking functionshw/core/qdev.c include/hw/qdev-core.h+42 -160 replies
3/3qdev: switch reset to post-orderhw/core/qdev.c hw/pci/pci.c include/hw/qdev-core.h+20 -190 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchClaudio Bley
1/3T-b
2/3T-b
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 1.5 0/3] qdev: switch reset to post-order

I was going to keep these for 1.6, but since they have been tested by the user and myself, and they fix a regression, it can be worthwhile to include these in 1.5.

qdev reset (qdev_reset_all/qbus_reset_all) is currently done in pre-order. This is not right, because it means the parent devices cannot expect anything about the children devices' state during the reset callback.

With the traversal done *before* invoking the bus-reset callback, there is no way for the bus-reset callback to take care of the device tree traversal. This is currently done only for PCI, which requires some adjustments.

This fixes a crash in resetting the LSI SCSI adapter, as reported and tested by Claudio Bley.

Paolo Bonzini (3):
pci: do not export pci_bus_reset
qdev: allow both pre- and post-order vists in qdev walking functions
qdev: switch reset to post-order

 hw/core/qdev.c         | 47 ++++++++++++++++++++++++++++++++++-------------
 hw/pci/pci.c           | 37 +++++++++++++++++--------------------
 hw/pci/pci_bridge.c    |  2 +-
 include/hw/pci/pci.h   |  1 -
 include/hw/qdev-core.h | 15 ++++++++++-----
 5 files changed, 62 insertions(+), 40 deletions(-)
Signature · 1 line
1.8.2