qemu-e2k/hw/sd
Markus Armbruster 71e5770b61 sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device
pxa2xx_mmci_init() creates a "pxa2xx-mmci" device, but neglects to
realize it.  Affects machines akita, borzoi, connex, mainstone, spitz,
terrier, tosa, verdex, and z2.

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.

This one appears 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 it right away.  Visible in "info qom-tree"; here's
the change for akita:

     /machine (akita-machine)
       [...]
       /unattached (container)
         [...]
    +    /device[5] (pxa2xx-mmci)
    +      /pxa2xx-mmci[0] (qemu:memory-region)
    +      /sd-bus (pxa2xx-mmci-bus)
         [rest of device[*] renumbered...]

Fixes: 7a9468c925
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200609122339.937862-4-armbru@redhat.com>
2020-06-15 21:36:09 +02:00
..
Kconfig hw/sd/sdhci: Move PCI-related code into a separate file 2019-03-12 07:49:04 +01:00
Makefile.objs hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
allwinner-sdhost.c hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
aspeed_sdhci.c hw/sd: Configure number of slots exposed by the ASPEED SDHCI model 2020-01-30 16:02:02 +00:00
bcm2835_sdhost.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
core.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
milkymist-memcard.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
omap_mmc.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pl181.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pxa2xx_mmci.c sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device 2020-06-15 21:36:09 +02:00
sd.c error: Use error_reportf_err() where appropriate 2020-05-27 07:45:30 +02:00
sdhci-internal.h qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci-pci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdmmc-internal.c sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
sdmmc-internal.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
ssi-sd.c hw/sd/ssi-sd: fix error handling in ssi_sd_realize 2020-03-17 17:30:03 +01:00
trace-events hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00