qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resetting non-qdev children in a 3-phase reset device


From: Peter Maydell
Subject: Re: Resetting non-qdev children in a 3-phase reset device
Date: Mon, 26 Apr 2021 10:09:58 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]