From f98a145cb725c63027b0d33bb01b8041d743b886 Mon Sep 17 00:00:00 2001 From: Sid Manning Date: Fri, 3 Jan 2025 11:42:41 -0800 Subject: [PATCH] Update initialization sequence to fix l2vic interrupts Looks like qdev_realize_and_unref must be called first otherwise the associated irqs functions are null. Signed-off-by: Sid Manning --- hw/hexagon/hexagon_dsp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index 38cee6d56cc1..f7151aa59c05 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -124,6 +124,9 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev, if (i == 0) { hexagon_init_bootstrap(machine, cpu); + if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { + return; + } DeviceState *l2vic_dev; l2vic_dev = sysbus_create_varargs("l2vic", m_cfg->l2vic_base, /* IRQ#, Evnt#,CauseCode */ @@ -139,8 +142,7 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev, sysbus_mmio_map(SYS_BUS_DEVICE(l2vic_dev), 1, m_cfg->cfgtable.fastl2vic_base << 16); } - - if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { + else if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { return; }