From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, berrange@redhat.com,
david@gibson.dropbear.id.au, Damien Hedde <damien.hedde@dahe.fr>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [PATCH v4 02/10] hw/core: create Resettable QOM interface
Date: Thu, 11 Apr 2024 19:23:00 +0200 [thread overview]
Message-ID: <6b384586-c7ad-4b6c-a1f1-8a8d8b0ad526@linaro.org> (raw)
In-Reply-To: <CAFEAcA8FUgmnq0-QfutpbN=xkeKxRe75b56Fu2zoXknXczwnvA@mail.gmail.com>
On 11/4/24 15:43, Peter Maydell wrote:
> On Wed, 21 Aug 2019 at 17:34, Damien Hedde <damien.hedde@greensocs.com> wrote:
>>
>> This commit defines an interface allowing multi-phase reset. This aims
>> to solve a problem of the actual single-phase reset (built in
>> DeviceClass and BusClass): reset behavior is dependent on the order
>> in which reset handlers are called. In particular doing external
>> side-effect (like setting an qemu_irq) is problematic because receiving
>> object may not be reset yet.
>
> So, I wanted to drag up this ancient patch to ask a couple
> of Resettable questions, because I'm working on adding a
> new ResetType (the equivalent of SHUTDOWN_CAUSE_SNAPSHOT_LOAD).
>
>> +/**
>> + * ResetType:
>> + * Types of reset.
>> + *
>> + * + Cold: reset resulting from a power cycle of the object.
>> + *
>> + * TODO: Support has to be added to handle more types. In particular,
>> + * ResetState structure needs to be expanded.
>> + */
>
> Does anybody remember what this TODO comment is about? What
> in particular would need to be in the ResetState struct
> to allow another type to be added?
IIRC this comes from this discussion:
https://lore.kernel.org/qemu-devel/7c193b33-8188-2cda-cbf2-fb545254458b@greensocs.com/
Updated in this patch (see after '---' description):
https://lore.kernel.org/qemu-devel/20191018150630.31099-9-damien.hedde@greensocs.com/
>
>> +typedef enum ResetType {
>> + RESET_TYPE_COLD,
>> +} ResetType;
>
>> +typedef void (*ResettableInitPhase)(Object *obj, ResetType type);
>> +typedef void (*ResettableHoldPhase)(Object *obj);
>> +typedef void (*ResettableExitPhase)(Object *obj);
>
> Was there a reason why we only pass the ResetType to the init
> phase method, and not also to the hold and exit phases ?
> Given that many devices don't need to implement init, it
> seems awkward to require them to do so just to stash the
> ResetType somewhere so they can look at it in the hold
> or exit phase, so I was thinking about adding the argument
> to the other two phase methods.
You are right, the type should be propagated to to all phase
handlers.
>
> thanks
> -- PMM
next prev parent reply other threads:[~2024-04-11 17:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 16:33 [Qemu-devel] [PATCH v4 00/10] Multi-phase reset mechanism Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 01/10] add device_legacy_reset function to prepare for reset api change Damien Hedde
2019-08-24 9:50 ` David Gibson
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 02/10] hw/core: create Resettable QOM interface Damien Hedde
2019-09-11 8:06 ` David Gibson
2019-09-11 14:56 ` Damien Hedde
2019-09-18 9:11 ` David Gibson
2019-09-24 11:21 ` Damien Hedde
2019-09-27 13:07 ` Peter Maydell
2019-10-10 9:18 ` Damien Hedde
2024-04-11 13:43 ` Peter Maydell
2024-04-11 17:23 ` Philippe Mathieu-Daudé [this message]
2024-04-12 13:05 ` Peter Maydell
2024-04-12 13:38 ` Edgar E. Iglesias
2024-04-12 16:12 ` Peter Maydell
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 03/10] hw/core: add Resettable interface in Bus and Device classes Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 04/10] docs/devel/reset.txt: create doc about Resettable interface Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 05/10] vl.c: replace deprecated qbus_reset_all registration Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 06/10] hw/s390x/ipl.c: " Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 07/10] hw/core/qdev: replace deprecated device_legacy_reset when hotplugging device Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 08/10] hw/core/resettable: add support for warm reset Damien Hedde
2020-05-10 20:17 ` Philippe Mathieu-Daudé
2020-05-11 9:37 ` Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 09/10] hw/core/: add warm reset helpers for devices and buses Damien Hedde
2019-08-21 16:33 ` [Qemu-devel] [PATCH v4 10/10] docs/devel/reset.txt: add documentation about warm reset Damien Hedde
2019-08-21 17:09 ` [Qemu-devel] [PATCH v4 00/10] Multi-phase reset mechanism no-reply
2019-09-10 10:33 ` Damien Hedde
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=6b384586-c7ad-4b6c-a1f1-8a8d8b0ad526@linaro.org \
--to=philmd@linaro.org \
--cc=berrange@redhat.com \
--cc=damien.hedde@dahe.fr \
--cc=david@gibson.dropbear.id.au \
--cc=edgar.iglesias@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).