qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] qdev: Ensure devices are fully realized when calling DeviceReset handler
@ 2023-09-18 10:17 Philippe Mathieu-Daudé
  2023-09-18 10:17 ` [PATCH 1/2] hw/sd/omap_mmc: Do not reset SDCard until being fully realized Philippe Mathieu-Daudé
  2023-09-18 10:17 ` [PATCH 2/2] qdev: Ensure devices are fully realized when calling DeviceReset handler Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-18 10:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Daniel P . Berrange, Eduardo Habkost,
	Alistair Francis, Paolo Bonzini, Anton Johansson,
	Edgar E . Iglesias, Markus Armbruster, Alex Bennée,
	Cédric Le Goater, Mark Cave-Ayland, Bernhard Beschow,
	Peter Maydell, Alessandro Di Federico, qemu-arm, Luc Michel,
	Philippe Mathieu-Daudé

In the process of clarifying QOM/QDev design, we want to enforce
the QDev state machine, in particular RESET can only happens *after*
REALIZE.

Besides CPUs (which are still particular), the only case I noticed
is in a non-QDev type (OMAP MMC) accessing a QDev one (SD/MMC card).

The first patch first handle the OMAP MMC case doing minor surgery
(passing a 'realized' state to omap_mmc_reset(), the function doing
reset out of normal QDev RESET tree propagation).

The second patch add an assertion in QDev core code, in order to
avoid further devices being added out of (QDev) order.

Please review,

Phil.

Philippe Mathieu-Daudé (2):
  hw/sd/omap_mmc: Do not reset SDCard until being fully realized
  qdev: Ensure devices are fully realized when calling DeviceReset
    handler

 include/hw/arm/omap.h |  2 +-
 hw/arm/omap1.c        |  2 +-
 hw/arm/omap2.c        |  2 +-
 hw/core/qdev.c        |  3 +++
 hw/sd/omap_mmc.c      | 21 ++++++++++++---------
 5 files changed, 18 insertions(+), 12 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-18 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 10:17 [PATCH 0/2] qdev: Ensure devices are fully realized when calling DeviceReset handler Philippe Mathieu-Daudé
2023-09-18 10:17 ` [PATCH 1/2] hw/sd/omap_mmc: Do not reset SDCard until being fully realized Philippe Mathieu-Daudé
2023-09-18 11:00   ` Peter Maydell
2023-09-18 15:22     ` Philippe Mathieu-Daudé
2023-09-18 10:17 ` [PATCH 2/2] qdev: Ensure devices are fully realized when calling DeviceReset handler Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).