On 29/5/22 21:06, Bernhard Beschow wrote:
Am 28. Mai 2022 09:19:29 UTC schrieb Mark Cave-Ayland 
<mark.cave-ayl...@ilande.co.uk>:
Use the new piix4_pm_init() instance init function to initialise 2 separate qdev
gpios for the SCI and SMI IRQs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
---
hw/acpi/piix4.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index d897d2dee6..454fa34df1 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -497,6 +497,14 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
     piix4_pm_add_properties(s);
}

+static void piix4_pm_init(Object *obj)
+{
+    PIIX4PMState *s = PIIX4_PM(obj);
+
+    qdev_init_gpio_out(DEVICE(obj), &s->irq, 1);
+    qdev_init_gpio_out_named(DEVICE(obj), &s->smi_irq, "smi-irq", 1);
+}

The two IRQs still get connected internally. Doesn't this create the risk of 
double connections until patches 8 and 9 are applied?

The same field is initialized twice indeed, but we shouldn't have "double connections". It could be cleaner to split this patch
and squash in the following 2 patches. Can do.

Reply via email to