qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Damien Hedde" <damien.hedde@greensocs.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: Resetting non-qdev children in a 3-phase reset device
Date: Mon, 26 Apr 2021 10:09:58 +0100	[thread overview]
Message-ID: <CAFEAcA_d5SQMCD7CLPmuLw9emkHAw1pvvXOJZ+RUuryZeQJJEw@mail.gmail.com> (raw)
In-Reply-To: <878s5539ni.fsf@dusky.pond.sub.org>

On Mon, 26 Apr 2021 at 06:19, Markus Armbruster <armbru@redhat.com> wrote:
> device_legacy_reset() is deprecated:
>
>     /**
>      * device_legacy_reset:
>      *
>      * Reset a single device (by calling the reset method).
>      * Note: This function is deprecated and will be removed when it becomes unused.
>      * Please use device_cold_reset() now.
>      */
>     void device_legacy_reset(DeviceState *dev);
>
> Good to know, but how do we get from here to there?  If we could simply
> replace one call by the other, surely we'd have done it already.

device_legacy_reset() semantics:
 * call the reset method on this device, and do nothing else
device_cold_reset() semantics:
 * call the reset method on this device
 * reset any qbuses this device owns (and so on recursively
   down the qbus tree)

So if the device has no qbuses they're equivalent and we can
just replace one call with the other. If the device does have
a qbus then it's more complicated (and I would start by asking
"do we really want to simulate power-cycling the device but *not*
power-cycling of its bus here?"...)

There are less than 20 callers of device_legacy_reset(), I guess
we should at least go through and identify "which of these are
definitely not resetting a device with qbuses" and update those.

thanks
-- PMM


  reply	other threads:[~2021-04-26  9:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 18:13 Resetting non-qdev children in a 3-phase reset device Peter Maydell
2021-04-18 20:16 ` Philippe Mathieu-Daudé
2021-04-19  9:03   ` Peter Maydell
2021-04-22 13:21     ` Markus Armbruster
2021-04-22 14:20       ` Philippe Mathieu-Daudé
2021-04-23 23:06         ` Philippe Mathieu-Daudé
2021-04-23 23:28           ` Philippe Mathieu-Daudé
2021-04-24  5:28             ` Markus Armbruster
2021-04-24 13:04               ` Philippe Mathieu-Daudé
2021-04-24 13:15                 ` Philippe Mathieu-Daudé
2021-04-25 18:33                 ` Peter Maydell
2021-04-26  5:19                   ` Markus Armbruster
2021-04-26  9:09                     ` Peter Maydell [this message]
2021-04-26  9:23                   ` Philippe Mathieu-Daudé
2021-04-26  9:33                     ` Peter Maydell
2021-04-26 11:14                       ` 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=CAFEAcA_d5SQMCD7CLPmuLw9emkHAw1pvvXOJZ+RUuryZeQJJEw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=armbru@redhat.com \
    --cc=damien.hedde@greensocs.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).