qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Daniel P . Berrange" <berrange@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Anton Johansson" <anjo@rev.ng>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Bernhard Beschow" <shentey@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alessandro Di Federico" <ale@rev.ng>,
	qemu-arm@nongnu.org, "Luc Michel" <luc@lmichel.fr>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 0/2] qdev: Ensure devices are fully realized when calling DeviceReset handler
Date: Mon, 18 Sep 2023 12:17:34 +0200	[thread overview]
Message-ID: <20230918101736.23905-1-philmd@linaro.org> (raw)

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



             reply	other threads:[~2023-09-18 10:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-18 10:17 Philippe Mathieu-Daudé [this message]
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é

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230918101736.23905-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=ale@rev.ng \
    --cc=alex.bennee@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=anjo@rev.ng \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@kaod.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=luc@lmichel.fr \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).