hw/fsi: move OPBus qbus_init() to instance_init
Remove the TODO comment that documented the workaround, as it is no longer needed. Suggested-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
May 4, 2026 at 11:40 UTC
6c586c4ba9545ad8c9cc3aa5415c0aaebd72957d
1 file changed
+1
-12
hw/fsi/aspeed_apb2opb.c
+1
-12
@@ -273,6 +273,7 @@ static void fsi_aspeed_apb2opb_init(Object *o)
273
for (i = 0; i < ASPEED_FSI_NUM; i++) {
274
object_initialize_child(o, "fsi-master[*]", &s->fsi[i],
275
TYPE_FSI_MASTER);
276
+ qbus_init(&s->opb[i], sizeof(s->opb[i]), TYPE_OP_BUS, DEVICE(s), NULL);
277
}
278
}
279
@@ -282,18 +283,6 @@ static void fsi_aspeed_apb2opb_realize(DeviceState *dev, Error **errp)
283
AspeedAPB2OPBState *s = ASPEED_APB2OPB(dev);
284
int i;
285
285
- /*
286
- * TODO: The OPBus model initializes the OPB address space in
287
- * the .instance_init handler and this is problematic for test
288
- * device-introspect-test. To avoid a memory corruption and a QEMU
289
- * crash, qbus_init() should be called from realize(). Something to
290
- * improve. Possibly, OPBus could also be removed.
291
- */
292
- for (i = 0; i < ASPEED_FSI_NUM; i++) {
293
- qbus_init(&s->opb[i], sizeof(s->opb[i]), TYPE_OP_BUS, DEVICE(s),
294
- NULL);
295
- }
296
-
286
sysbus_init_irq(sbd, &s->irq);
287
288
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_apb2opb_ops, s,