qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [PATCH v2 5/9] hw/block/pflash_cfi01: Add the DeviceReset


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v2 5/9] hw/block/pflash_cfi01: Add the DeviceReset() handler
Date: Tue, 2 Jul 2019 10:23:06 +0100

On Tue, 2 Jul 2019 at 04:16, John Snow <address@hidden> wrote:
> Does reset always get called as part of realize, really?
>
> Or are we just trusting that the device is probably going to get reset
> by the guest during bringup?

Reset is not called "as part of realize", but it is guaranteed
to be called after realize and before we try to run the guest,
as long as the device is in the qbus tree. Things are in the
qbus tree if either:
 * they're plugged into something already in the tree (eg
   pci devices, scsi disks)
 * they're a sysbus device (which is automatically plugged into
   the 'main system bus' which is effectively the root of the
   qbus tree)

In this case TYPE_PFLASH_CFI01 is a subclass of TYPE_SYS_BUS_DEVICE,
so it will always be reset as part of system reset.

(the main things which don't get automatically reset are direct
subclasses of TYPE_DEVICE, notably CPU objects.)

thanks
-- PMM



reply via email to

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