qemu-e2k/hw/i2c
Peter Maydell 6c50845a91 hw/i2c/allwinner-i2c: Fix subclassing of TYPE_AW_I2C_SUN6I
In commit 8461bfdca9 we added the TYPE_AW_I2C_SUN6I, which is a
minor variant of the TYPE_AW_I2C device.  However, we didn't quite
get the class hierarchy right.  We made the new TYPE_AW_I2C_SUN6I a
subclass of TYPE_SYS_BUS_DEVICE, which means that you can't validly
use a pointer to this object via the AW_I2C() cast macro, which
insists on having something that is an instance of TYPE_AW_I2C or
some subclass of that type.

This only causes a problem if QOM cast macro debugging is enabled;
that is supposed to be on by default, but a mistake in the meson
conversion in commit c55cf6ab03 meant that it ended up disabled by
default, and we didn't catch this bug.

Fix the problem by arranging the classes in the same way we do for
TYPE_PL011 and TYPE_PL011_LUMINARY in hw/char/pl011.c -- make the
variant class be a subclass of the "normal" version of the device.

This was reported in
https://gitlab.com/qemu-project/qemu/-/issues/1586 but this fix alone
isn't sufficient, as there is a separate cast-related issue in the
CXL code in pci_expander_bridge.c.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
2023-04-11 14:13:29 +01:00
..
allwinner-i2c.c hw/i2c/allwinner-i2c: Fix subclassing of TYPE_AW_I2C_SUN6I 2023-04-11 14:13:29 +01:00
arm_sbcon_i2c.c hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c 2023-01-23 13:32:38 +00:00
aspeed_i2c.c hw/i2c: only schedule pending master when bus is idle 2023-03-02 13:57:50 +01:00
bitbang_i2c.c hw/i2c/bitbang_i2c: Convert DPRINTF() to trace events 2023-01-23 13:32:38 +00:00
core.c hw/i2c: only schedule pending master when bus is idle 2023-03-02 13:57:50 +01:00
exynos4210_i2c.c
i2c_mux_pca954x.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
imx_i2c.c hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() 2021-07-08 14:15:01 -05:00
Kconfig hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c 2023-01-23 13:32:38 +00:00
meson.build hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c 2023-01-23 13:32:38 +00:00
microbit_i2c.c
mpc_i2c.c bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx 2023-01-18 11:14:34 +01:00
npcm7xx_smbus.c hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init() 2021-03-05 15:17:34 +00:00
omap_i2c.c
pm_smbus.c hw/i2c: Introduce i2c_start_recv() and i2c_start_send() 2021-07-08 14:15:01 -05:00
pmbus_device.c hw/i2c: pmbus: block uninitialised string reads 2023-03-30 15:03:36 +02:00
ppc4xx_i2c.c hw/i2c/ppc4xx_i2c: Replace i2c_send_recv() by i2c_recv() & i2c_send() 2021-07-08 14:15:01 -05:00
smbus_eeprom.c i2c/smbus_eeprom: Add feature bit to SPD data 2021-07-29 10:59:49 +10:00
smbus_ich9.c hw: Move ich9.h to southbridge/ 2023-02-27 22:29:01 +01:00
smbus_master.c hw/i2c: Introduce i2c_start_recv() and i2c_start_send() 2021-07-08 14:15:01 -05:00
smbus_slave.c hw/i2c: add asynchronous send 2022-06-30 09:21:14 +02:00
trace-events hw/i2c/bitbang_i2c: Convert DPRINTF() to trace events 2023-01-23 13:32:38 +00:00
trace.h