From nobody Wed Oct 1 06:21:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584175103; cv=none; d=zohomail.com; s=zohoarc; b=BI7x0urlujG5exfCfga4gtowl+4pJg/z/ScsuznWq9nXuIVSA/jGQQIbeb2+8ocZqb1e9jKgBFn48WWjC4o1xXWqHgwFkeqxcVWpsSQqZc0qxrrKwhzmEe4/Pa11fN70WhrAy6pr0cBSlotpz6XrbuPI6icbCWw/Ow2nqYVQqOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584175103; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fli8d5I1ZMmVOCaMKFsfXkazYuzkfE2opj7WkwcWWik=; b=mM68SN0w08+WzCrPbAIS13vL+FRXduCPRV18qgZhGv7drmEtnO86GXbqa72qtg9dM4Sud1ddelG8sK/aAl/7cZ7v5O2oFAXIj8AyPqe7D5vn26c68eUkxmIsxV9OctwX5FY/Cel4R5ROxiboFTgYXn7Ji0FnIQLq6kXwCHyV3rI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584175103821164.23449734334315; Sat, 14 Mar 2020 01:38:23 -0700 (PDT) Received: from localhost ([::1]:42530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jD2JK-000249-JV for importer@patchew.org; Sat, 14 Mar 2020 04:38:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54540) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jD2HD-0006cy-7D for qemu-devel@nongnu.org; Sat, 14 Mar 2020 04:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jD2HC-0004fE-4q for qemu-devel@nongnu.org; Sat, 14 Mar 2020 04:36:11 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53342 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jD2HB-0004M0-P3; Sat, 14 Mar 2020 04:36:10 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 125627FA44D9298E9226; Sat, 14 Mar 2020 16:36:03 +0800 (CST) Received: from localhost.huawei.com (10.175.104.216) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Sat, 14 Mar 2020 16:35:54 +0800 From: Pan Nengyuan To: Subject: [PATCH v5 3/4] hw/misc/macio: fix incorrect creation of mos6522's subclasses Date: Sat, 14 Mar 2020 16:47:29 +0800 Message-ID: <20200314084730.25876-4-pannengyuan@huawei.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200314084730.25876-1-pannengyuan@huawei.com> References: <20200314084730.25876-1-pannengyuan@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.216] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.249.212.35 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, zhang.zhanghailiang@huawei.com, Pan Nengyuan , Mark Cave-Ayland , qemu-ppc@nongnu.org, euler.robot@huawei.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are two other places where we create mos6522's subclasses but forgot = to realize it. This patch do the realize in these places to fix that. Signed-off-by: Pan Nengyuan --- Cc: Mark Cave-Ayland Cc: David Gibson Cc: qemu-ppc@nongnu.org --- v5: - Also fix incorrect creation of mos6522's subclasses on two other places. Not sure if there is a conversion plan, we still keep sysbus_init_child_o= bj in init() in this patch as it was. --- hw/misc/macio/cuda.c | 11 +++++++++-- hw/misc/macio/pmu.c | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index e0cc0aac5d..ee780a8288 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -36,6 +36,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qapi/error.h" #include "trace.h" =20 /* Bits in B data register: all active low */ @@ -524,11 +525,17 @@ static void cuda_realize(DeviceState *dev, Error **er= rp) CUDAState *s =3D CUDA(dev); SysBusDevice *sbd; MOS6522State *ms; - DeviceState *d; + DeviceState *d =3D DEVICE(&s->mos6522_cuda); struct tm tm; + Error *err =3D NULL; + + object_property_set_bool(OBJECT(d), true, "realized", &err); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } =20 /* Pass IRQ from 6522 */ - d =3D DEVICE(&s->mos6522_cuda); ms =3D MOS6522(d); sbd =3D SYS_BUS_DEVICE(s); sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms)); diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index b8466a4a3f..ae55992288 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -43,6 +43,7 @@ #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qapi/error.h" #include "trace.h" =20 =20 @@ -741,11 +742,17 @@ static void pmu_realize(DeviceState *dev, Error **err= p) PMUState *s =3D VIA_PMU(dev); SysBusDevice *sbd; MOS6522State *ms; - DeviceState *d; + DeviceState *d =3D DEVICE(&s->mos6522_pmu);; struct tm tm; + Error *err =3D NULL; + + object_property_set_bool(OBJECT(d), true, "realized", &err); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } =20 /* Pass IRQ from 6522 */ - d =3D DEVICE(&s->mos6522_pmu); ms =3D MOS6522(d); sbd =3D SYS_BUS_DEVICE(s); sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms)); --=20 2.18.2