qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [PULL 10/84] mac_via: Fix to realize "mos6522-q800-via*" devices
Date: Mon, 15 Jun 2020 22:38:54 +0200	[thread overview]
Message-ID: <20200615204008.3069956-11-armbru@redhat.com> (raw)
In-Reply-To: <20200615204008.3069956-1-armbru@redhat.com>

mac_via_realize() creates a "mos6522-q800-via1" and a
"mos6522-q800-via2" device, but neglects to realize them.  Affects
machine q800.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

These two appear to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing them right away.

Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200609122339.937862-9-armbru@redhat.com>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/misc/mac_via.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index e05623d730..82614c155a 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -890,6 +890,11 @@ static void mac_via_realize(DeviceState *dev, Error **errp)
     object_property_add_alias(OBJECT(dev), "irq[1]", OBJECT(ms),
                               SYSBUS_DEVICE_GPIO_IRQ "[0]");
 
+    object_property_set_bool(OBJECT(&m->mos6522_via1), true, "realized",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&m->mos6522_via2), true, "realized",
+                             &error_abort);
+
     /* Pass through mos6522 input IRQs */
     qdev_pass_gpios(DEVICE(&m->mos6522_via1), dev, "via1-irq");
     qdev_pass_gpios(DEVICE(&m->mos6522_via2), dev, "via2-irq");
-- 
2.26.2



  parent reply	other threads:[~2020-06-15 20:47 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 20:38 [PULL 00/84] QOM patches for 2020-06-15 Markus Armbruster
2020-06-15 20:38 ` [PULL 01/84] qom: Constify object_get_canonical_path{, _component}()'s parameter Markus Armbruster
2020-06-15 20:38 ` [PULL 02/84] qom: Make "info qom-tree" show children sorted Markus Armbruster
2020-06-15 20:38 ` [PULL 03/84] arm/stm32f405: Fix realization of "stm32f2xx-adc" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 04/84] display/xlnx_dp: Fix to realize "i2c-ddc" and "aux-to-i2c-bridge" Markus Armbruster
2020-06-15 20:38 ` [PULL 05/84] sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device Markus Armbruster
2020-06-15 20:38 ` [PULL 06/84] arm/aspeed: Compute the number of CPUs from the SoC definition Markus Armbruster
2020-06-15 20:38 ` [PULL 07/84] arm/aspeed: Rework NIC attachment Markus Armbruster
2020-06-15 20:38 ` [PULL 08/84] armv7m: Delete unused "ARM,bitband-memory" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 09/84] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave Markus Armbruster
2020-06-15 20:38 ` Markus Armbruster [this message]
2020-06-15 20:38 ` [PULL 11/84] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 12/84] macio: Delete unused "macio-gpio" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 13/84] pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 14/84] MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well Markus Armbruster
2020-06-15 20:38 ` [PULL 15/84] ppc4xx: Drop redundant device realization Markus Armbruster
2020-06-15 20:39 ` [PULL 16/84] macio: Put "macio-nvram" device on the macio bus Markus Armbruster
2020-06-15 20:58   ` BALATON Zoltan
2020-06-16  6:48     ` Philippe Mathieu-Daudé
2020-06-15 20:39 ` [PULL 17/84] macio: Fix macio-bus to be a subtype of System bus Markus Armbruster
2020-06-15 20:39 ` [PULL 18/84] ppc/pnv: Put "*-pnv-chip" and "pnv-xive" on the main system bus Markus Armbruster
2020-06-15 20:39 ` [PULL 19/84] pnv/psi: Correct the pnv-psi* devices not to be sysbus devices Markus Armbruster
2020-06-15 20:39 ` [PULL 20/84] display/sm501 display/ati: Fix to realize "i2c-ddc" Markus Armbruster
2020-06-15 20:39 ` [PULL 21/84] riscv: Fix to put "riscv.hart_array" devices on sysbus Markus Armbruster
2020-06-15 20:39 ` [PULL 22/84] riscv: Fix type of SiFive[EU]SocState, member parent_obj Markus Armbruster
2020-06-15 20:39 ` [PULL 23/84] sparc/leon3: Fix to put grlib,* devices on sysbus Markus Armbruster
2020-06-15 20:39 ` [PULL 24/84] qdev: Assert devices are plugged into a bus that can take them Markus Armbruster
2020-06-15 20:39 ` [PULL 25/84] sd: Hide the qdev-but-not-quite thing created by sd_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 26/84] qdev: Assert onboard devices all get realized properly Markus Armbruster
2020-06-15 20:39 ` [PULL 27/84] qdev: Rename qbus_realize() to qbus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 28/84] Revert "hw/prep: realize the PCI root bus as part of the prep init" Markus Armbruster
2020-06-15 20:39 ` [PULL 29/84] Revert "hw/versatile: realize the PCI root bus as part of the versatile init" Markus Armbruster
2020-06-15 20:39 ` [PULL 30/84] qdev: New qdev_new(), qdev_realize(), etc Markus Armbruster
2020-06-15 20:39 ` [PULL 31/84] qdev: Put qdev_new() to use with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 32/84] qdev: Convert to qbus_realize(), qbus_unrealize() Markus Armbruster
2020-06-15 20:39 ` [PULL 33/84] qdev: Convert to qdev_unrealize() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 34/84] qdev: Convert to qdev_unrealize() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 35/84] qdev: Convert uses of qdev_create() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 36/84] qdev: Convert uses of qdev_create() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 37/84] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 38/84] qdev: Convert uses of qdev_set_parent_bus() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 39/84] pci: New pci_new(), pci_realize_and_unref() etc Markus Armbruster
2020-06-15 20:39 ` [PULL 40/84] hw/ppc: Eliminate two superfluous QOM casts Markus Armbruster
2020-06-15 20:39 ` [PULL 41/84] pci: Convert uses of pci_create() etc. with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 42/84] pci: Convert uses of pci_create() etc. manually Markus Armbruster
2020-06-15 20:39 ` [PULL 43/84] pci: pci_create(), pci_create_multifunction() are now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 44/84] isa: New isa_new(), isa_realize_and_unref() etc Markus Armbruster
2020-06-15 20:39 ` [PULL 45/84] isa: Convert uses of isa_create() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 46/84] isa: Convert uses of isa_create(), isa_try_create() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 47/84] isa: isa_create(), isa_try_create() are now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 48/84] ssi: ssi_auto_connect_slaves() never does anything, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 49/84] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 50/84] ssi: Convert last use of ssi_create_slave_no_init() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 51/84] ssi: ssi_create_slave_no_init() is now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 52/84] usb: New usb_new(), usb_realize_and_unref() Markus Armbruster
2020-06-15 20:39 ` [PULL 53/84] usb: Convert uses of usb_create() Markus Armbruster
2020-06-15 20:39 ` [PULL 54/84] usb: usb_create() is now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 55/84] usb: Eliminate usb_try_create_simple() Markus Armbruster
2020-06-15 20:39 ` [PULL 56/84] qdev: qdev_create(), qdev_try_create() are now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 57/84] auxbus: Rename aux_init_bus() to aux_bus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 58/84] auxbus: New aux_bus_realize(), pairing with aux_bus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 59/84] auxbus: Convert a use of qdev_set_parent_bus() Markus Armbruster
2020-06-15 20:39 ` [PULL 60/84] auxbus: Eliminate aux_create_slave() Markus Armbruster
2020-06-15 20:39 ` [PULL 61/84] qom: Tidy up a few object_initialize_child() calls Markus Armbruster
2020-06-15 20:39 ` [PULL 62/84] qom: Less verbose object_initialize_child() Markus Armbruster
2020-06-15 20:39 ` [PULL 63/84] macio: Convert use of qdev_set_parent_bus() Markus Armbruster
2020-06-15 20:39 ` [PULL 64/84] macio: Eliminate macio_init_child_obj() Markus Armbruster
2020-06-15 20:39 ` [PULL 65/84] sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls Markus Armbruster
2020-06-15 20:39 ` [PULL 66/84] microbit: Tidy up sysbus_init_child_obj() @child argument Markus Armbruster
2020-06-15 20:39 ` [PULL 67/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1 Markus Armbruster
2020-06-15 20:39 ` [PULL 68/84] hw/arm/armsse: Pass correct child size to sysbus_init_child_obj() Markus Armbruster
2020-06-15 20:39 ` [PULL 69/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2 Markus Armbruster
2020-06-15 20:39 ` [PULL 70/84] sysbus: New sysbus_realize(), sysbus_realize_and_unref() Markus Armbruster
2020-06-15 20:39 ` [PULL 71/84] sysbus: Convert to sysbus_realize() etc. with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 72/84] qdev: Drop qdev_realize() support for null bus Markus Armbruster
2020-06-15 20:39 ` [PULL 73/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1 Markus Armbruster
2020-06-15 20:39 ` [PULL 74/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2 Markus Armbruster
2020-06-15 20:39 ` [PULL 75/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3 Markus Armbruster
2020-06-15 20:40 ` [PULL 76/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4 Markus Armbruster
2020-06-15 20:40 ` [PULL 77/84] sysbus: sysbus_init_child_obj() is now unused, drop Markus Armbruster
2020-06-15 20:40 ` [PULL 78/84] microbit: Eliminate two local variables in microbit_init() Markus Armbruster
2020-06-15 20:40 ` [PULL 79/84] s390x/event-facility: Simplify creation of SCLP event devices Markus Armbruster
2020-06-15 20:40 ` [PULL 80/84] qdev: Make qdev_realize() support bus-less devices Markus Armbruster
2020-06-15 20:40 ` [PULL 81/84] qdev: Use qdev_realize() in qdev_device_add() Markus Armbruster
2020-06-15 20:40 ` [PULL 82/84] qdev: Convert bus-less devices to qdev_realize() with Coccinelle Markus Armbruster
2020-06-15 20:40 ` [PULL 83/84] qdev: qdev_init_nofail() is now unused, drop Markus Armbruster
2020-06-15 20:40 ` [PULL 84/84] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well Markus Armbruster
2020-06-16 12:26 ` [PULL 00/84] QOM patches for 2020-06-15 Peter Maydell
2020-06-16 15:26   ` Thomas Huth
2020-06-17  3:30     ` Philippe Mathieu-Daudé
2020-06-26 18:28 ` Peter Maydell
2020-06-27 11:53   ` Markus Armbruster
2020-06-27 15:11     ` Peter Maydell
2020-06-29  7:25       ` 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=20200615204008.3069956-11-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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).