[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/8] hw/acpi/piix4: Convert reset handler to DeviceReset
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH v2 1/8] hw/acpi/piix4: Convert reset handler to DeviceReset |
Date: |
Wed, 9 Oct 2019 15:17:44 -0400 |
On Tue, Oct 08, 2019 at 04:25:32PM +0200, Philippe Mathieu-Daudé wrote:
> The PIIX4/PM is a PCI device within the PIIX4 chipset, it will be reset
> when the PCI bus it stands on is reset.
>
> Convert its reset handler into a proper Device reset method.
>
> Reviewed-by: Igor Mammedov <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
feel free to take through the misc tree.
> ---
> hw/acpi/piix4.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index 5742c3df87..4e079b39bd 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -27,7 +27,6 @@
> #include "hw/pci/pci.h"
> #include "hw/qdev-properties.h"
> #include "hw/acpi/acpi.h"
> -#include "sysemu/reset.h"
> #include "sysemu/runstate.h"
> #include "sysemu/sysemu.h"
> #include "qapi/error.h"
> @@ -344,9 +343,9 @@ static const VMStateDescription vmstate_acpi = {
> }
> };
>
> -static void piix4_reset(void *opaque)
> +static void piix4_pm_reset(DeviceState *dev)
> {
> - PIIX4PMState *s = opaque;
> + PIIX4PMState *s = PIIX4_PM(dev);
> PCIDevice *d = PCI_DEVICE(s);
> uint8_t *pci_conf = d->config;
>
> @@ -542,7 +541,6 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
>
> s->machine_ready.notify = piix4_pm_machine_ready;
> qemu_add_machine_init_done_notifier(&s->machine_ready);
> - qemu_register_reset(piix4_reset, s);
>
> piix4_acpi_system_hot_add_init(pci_address_space_io(dev),
> pci_get_bus(dev), s);
> @@ -692,6 +690,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void
> *data)
> k->device_id = PCI_DEVICE_ID_INTEL_82371AB_3;
> k->revision = 0x03;
> k->class_id = PCI_CLASS_BRIDGE_OTHER;
> + dc->reset = piix4_pm_reset;
> dc->desc = "PM";
> dc->vmsd = &vmstate_acpi;
> dc->props = piix4_pm_properties;
> --
> 2.21.0
- [PATCH v2 0/8] hw: Convert various reset() handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 1/8] hw/acpi/piix4: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 2/8] hw/isa/piix4: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 3/8] hw/ide/piix: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 4/8] hw/ide/sii3112: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 5/8] hw/ide/via82c: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08
- [PATCH v2 6/8] hw/isa/vt82c686: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2019/10/08