Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3996151iob; Tue, 17 May 2022 11:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPLuVe5vIz57sdh6TH0uxkBAqG8C4L4ghpYbM6QNoSDw4hK+XYxyAGX1Oy4ub45KmWJvXy X-Received: by 2002:a17:906:58c5:b0:6f4:6991:f9f8 with SMTP id e5-20020a17090658c500b006f46991f9f8mr20294720ejs.510.1652812110912; Tue, 17 May 2022 11:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652812110; cv=none; d=google.com; s=arc-20160816; b=SEQxC7uMcmxU2q3A3IvyDS723JpLfhR5QFQHS3vwuDlZjTu42GjJypd1eJ7cYfcT8f KDp1oi068KS/J/5pZiIY69yAFb0wqcib+pb+yK8JYexmnlOcVNE5+i2lKDTRj0/D4kZn 4Zhip8K+u80cyHdsmPZbod9Zz1u004o4qZdEZ9lYfvyU9t9k9xmGV25AdZkQdNxdKoRL A+6O5dvGobxoKxP8aNQFS2iVwpDuMHMlyMX3Jahd/qBvOOSEwLqprCi9my4Uhp5bfAuT Y5P2a+1pGKIPQRX7KJbuvIZ1hsP4HPReJOSJsY1+7c2sK94Ge8eBqsNtErGRjNOc3rjt iR+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=cGUPuIBqdoAwF6CrSgCGhpb2rO2ZYTzLfr84zCXtbUA=; b=ueLkjrnS9YEj2teZrSkEQP48QcA+ovfU4yqzSq1sXfpr3dsbA+HW5nepqt9qQeKfSz QriNXQeGOX34Ctnp7RFYJIMpeRtYE0e0S/ic6A1s8TdddVcnKihiQXwU5g+PDYLDK1i+ nsSY7sqWX2UOP8QiCVin1LznWRH8G/Vqyt8b7d0APZ63BiWo1YuOEq3WhFQp2C/8npw4 4wNYaffbtnNsCZ/NRvtVC7wtERNgXZbOhZPDS72icu0BjauXFUx7Lqa79xjmTFIzXXpg 3tU8M2+n8o38DzfHRDqipR+KoYkDGSY61DqP/F1Aqt22FNEEjDvPgZ9icETDxSHcjdwm aGWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="ovXm/FsH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc23-20020a1709078a1700b006f39eac8ff0si4141ejc.243.2022.05.17.11.28.04; Tue, 17 May 2022 11:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="ovXm/FsH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242176AbiEQHkc (ORCPT + 99 others); Tue, 17 May 2022 03:40:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242507AbiEQHkF (ORCPT ); Tue, 17 May 2022 03:40:05 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F2D4B1D9; Tue, 17 May 2022 00:38:42 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B45F920002; Tue, 17 May 2022 07:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652773121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cGUPuIBqdoAwF6CrSgCGhpb2rO2ZYTzLfr84zCXtbUA=; b=ovXm/FsHnSnly3cug8E/YvUa+9uFuM/kadH6jEa5sy7xnlB4fzjbw0lWqNydOR96WeNOSc YaTpt0thgcY2ZVX5qZuyXZ/sOpC5fGAZqGO0Vj/vvIWmxu+k16Koe4sq/V87m5dTWIQvfD ejw3EQX4is5LVegbHsgC7yry9tluxAcJjwaKllYLWRYUiQEm0StXG+Z4O6Hagv6tiqSBro erZMqa2a6696y6yUJZ8BO4yw2buJrYO9C6I17kjrCdmJHPHeUypAE48cnhCA+gqMMS1vkz BMemUOTmiNwe8reMRoEhGECPonU6/WR5ilgDapGdwj1aPnDsaUFqZrgQHbKv0Q== Date: Tue, 17 May 2022 09:37:29 +0200 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Frank Rowand Cc: Rob Herring , Pantelis Antoniou , Bjorn Helgaas , Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Alexandre Belloni , Mark Brown , Andy Shevchenko , Jakub Kicinski , Hans de Goede , Andrew Lunn , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 1/3] of: always populate a root node Message-ID: <20220517093729.214c33a3@fixe.home> In-Reply-To: References: <20220427094502.456111-1-clement.leger@bootlin.com> <20220427094502.456111-2-clement.leger@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Mon, 16 May 2022 23:11:03 -0400, Frank Rowand a =C3=A9crit : > On 5/3/22 08:45, Rob Herring wrote: > > On Wed, Apr 27, 2022 at 11:45:00AM +0200, Cl=C3=A9ment L=C3=A9ger wrote= : =20 > >> When enabling CONFIG_OF on a platform where of_root is not populated by > >> firmware, we end up without a root node. In order to apply overlays and > >> create subnodes of the root node, we need one. This commit creates an > >> empty root node if not present. =20 > >=20 > > The existing unittest essentially does the same thing for running the=20 > > tests on non-DT systems. It should be modified to use this support=20 > > instead. Maybe that's just removing the unittest code that set of_root. > >=20 > > I expect Frank will have some comments. =20 >=20 > My preference would be for unflatten_and_copy_device_tree() to > use a compiled in FDT that only contains a root node, in the > case that no valid device tree is found (in other words, > "if (!initial_boot_params)". Ok, so basically, instead of creating the root node manually, you expect a device-tree which contains the following to be builtin the kernel and unflattened if needed: / { }; Maybe "chosen" and "aliases" nodes should also be provided as empty nodes since the unittest are creating them anyway and the core DT code also uses them. Thanks, Cl=C3=A9ment >=20 > unflatten_and_copy_device_tree() calls unittest_unflatten_overlay_base() > after unflattening the device tree passed into the booting kernel. This > step is needed for a specific portion of the unittests. >=20 > I'm still looking at the bigger picture of using overlays for the PCIe > card, so more comments will be coming about that bigger picture. >=20 > -Frank >=20 --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com