From nobody Sat May 4 14:07:57 2024 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=1575986431; cv=none; d=zohomail.com; s=zohoarc; b=gM8K7snGNqOMA//uX9tCvQ9peqROlklaAF01hZYnFVL04qgOjLbtTvYxeWwiN7rJbbn/y0hW8i/F1agtkJbMykvKZBjCxiVoXsYUiQa7PW+C/Tu0IZ9NKEBKsE3D85VcOhy9K/bprf7ZR9WxSXruLtSLNgyWYJg17nZ0Xg8Peas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575986431; h=Content-Type:Content-Transfer-Encoding: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=T82vIgJ+UMK5wA85PhggsX5KVizfa0qyaxXx5ookpU8=; b=kbtNNeoq8IPRXTSm8b5Yq9e9bofonQIq6xyhveSojeJOYjw1MsAp/LDvUVlJmsfEf+gTh7NB9HwEyUzb7sydxUoqERQWJZFHTAeW0V33doIktxARWIZWk2Awv8V+eiBWH308pyORFDR1DFb1PDxAxbzNvEoWHy+94sz28Qbj3MI= 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 1575986431654538.1043951821373; Tue, 10 Dec 2019 06:00:31 -0800 (PST) Received: from localhost ([::1]:57134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieg3w-000175-Vd for importer@patchew.org; Tue, 10 Dec 2019 09:00:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47113) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieg2g-00008r-Jt for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ieg2f-0002rJ-Mf for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:10 -0500 Received: from 2.mo68.mail-out.ovh.net ([46.105.52.162]:52345) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ieg2f-0002pX-H3 for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:09 -0500 Received: from player728.ha.ovh.net (unknown [10.108.57.14]) by mo68.mail-out.ovh.net (Postfix) with ESMTP id 0FFE914E23C for ; Tue, 10 Dec 2019 14:59:05 +0100 (CET) Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr [90.76.50.223]) (Authenticated sender: clg@kaod.org) by player728.ha.ovh.net (Postfix) with ESMTPSA id D159BD0AC39E; Tue, 10 Dec 2019 13:58:59 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes Date: Tue, 10 Dec 2019 14:58:44 +0100 Message-Id: <20191210135845.19773-2-clg@kaod.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191210135845.19773-1-clg@kaod.org> References: <20191210135845.19773-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11865014695531875302 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudelfedgheelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpledtrdejiedrhedtrddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejvdekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.52.162 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: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than the first layer, so we need to loop on the whole object hierarchy to catch them. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz --- hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index bed41840845e..006d87e970d9 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_of= fset) args.fdt =3D fdt; args.xscom_offset =3D xscom_offset; =20 - object_child_foreach(OBJECT(chip), xscom_dt_child, &args); + /* + * Loop on the whole object hierarchy to catch all + * PnvXScomInterface objects which can lie a bit deeper the first + * layer. + */ + object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args); return 0; } =20 --=20 2.21.0 From nobody Sat May 4 14:07:57 2024 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=1575986534; cv=none; d=zohomail.com; s=zohoarc; b=dzVfrMfl6SxiuF65jxU03OETBsdetnZkxXcB0z+AgVqgZ34HbrwKZ9KvG0861deb9DT3x53Q8J0OCwXrxwdgBKuVWYmeU+T2j8hMm3YQLmj1EDhI7I3gYWhgoYRfWc8Zw/60jnKpPw3MwV9uoq/Oo+tGE+VpBYv94fNSXTmJpE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575986534; h=Content-Type:Content-Transfer-Encoding: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=r1fCfBCeMGkpZBKPh5MGvQd6RND/62fSks4WCl4uD5g=; b=Ki44It4cnuqG65R8Cs20va/0IpSmrZ/0oxBBJBPYMndUpHO/1+f5sKra9npMXuaJLO3/xz/FAbauQUMKWjJFgXyQF5pG+7oJZ7ENTtDzdXMxO0NQFhED26kzFbxtB5Lwq9rDP0TJWAwm6ZWlYr/uyIo+NhBe5BDlaRyXcxv+xq4= 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 1575986534916101.05594721752482; Tue, 10 Dec 2019 06:02:14 -0800 (PST) Received: from localhost ([::1]:57200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieg5b-0002f2-QM for importer@patchew.org; Tue, 10 Dec 2019 09:02:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47142) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ieg2l-0000FO-3F for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ieg2k-0002sW-37 for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:14 -0500 Received: from 4.mo7.mail-out.ovh.net ([178.32.122.254]:46582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ieg2j-0002ry-TV for qemu-devel@nongnu.org; Tue, 10 Dec 2019 08:59:14 -0500 Received: from player728.ha.ovh.net (unknown [10.108.42.66]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 709E214269F for ; Tue, 10 Dec 2019 14:59:11 +0100 (CET) Received: from kaod.org (lfbn-1-2229-223.w90-76.abo.wanadoo.fr [90.76.50.223]) (Authenticated sender: clg@kaod.org) by player728.ha.ovh.net (Postfix) with ESMTPSA id B6589D0AC469; Tue, 10 Dec 2019 13:59:05 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices Date: Tue, 10 Dec 2019 14:58:45 +0100 Message-Id: <20191210135845.19773-3-clg@kaod.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191210135845.19773-1-clg@kaod.org> References: <20191210135845.19773-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11866703546555730918 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudelfedgheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpledtrdejiedrhedtrddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejvdekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.32.122.254 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: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Some devices could be initialized in the instance_init handler but not realized for configuration reasons. Nodes should not be added in the DT for such devices. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz --- hw/ppc/pnv_xscom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index 006d87e970d9..6d3745a49e50 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque) PnvXScomInterface *xd =3D PNV_XSCOM_INTERFACE(child); PnvXScomInterfaceClass *xc =3D PNV_XSCOM_INTERFACE_GET_CLASS(xd); =20 - if (xc->dt_xscom) { + /* + * Only "realized" devices should be configured in the DT + */ + if (xc->dt_xscom && DEVICE(child)->realized) { _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset))); } } --=20 2.21.0