Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp338964iob; Wed, 18 May 2022 03:24:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLagAJT/Lrnd1wYUqVA3B65CeRbfWY84Am8doH1NA4JQ8t5N2w7BkYKuANM3T02UaXpZlR X-Received: by 2002:a17:90b:4b42:b0:1dc:15f8:821b with SMTP id mi2-20020a17090b4b4200b001dc15f8821bmr41563987pjb.131.1652869485245; Wed, 18 May 2022 03:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652869485; cv=none; d=google.com; s=arc-20160816; b=iGZmsZfEyuGXniUyanB+LW2h1gOFZaCcMlR05+QGhdPWOXBrsa9ejaD+P2H9Zsu35E G360/6MdsadMFsfahtvS4HweKQB394NDM2hr77BdjnLGSAevbQ/I0UGytT/RZtKzjHmb MbztaLM6Uf3zX5vjbq6P7jE6GIalRqaeslvGa6P2Ls7acxd8U37gt1rICDTJKJtNnXwc AoNuU3z//pOwZnTQzTICkr0s5XyExPoSZxxjUENHNBtuIg3m22cycnxX7VPpGm4H9GU8 GtJb2a6/4Ju8iIhs/S2fyaK3+APHW+mFVklxJJVIVsRoqy/We+zcEmLZ53wmkvFF8J7y uBzA== 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=q7m8azLqYxqw7exPiKwgRaIReLLbq6ltOL8jkRp0nlI=; b=gR8Hs2LYEvgotAK/rm/KkoOeUsfRYiddzVA7/weyP6Dm0ZrwDotDEWucNmeFVPu8UJ YtFN9+4xOgrYkyM+p2ybf6XtYf2XWV3VHcDXMAM67Vmaq030jKNwBrdRppP2X4UrAUg4 xNzPSFsga4IPVI0FvfoTOkp/H1W92lvskKQc2BiYGJ0nfxQeYX6wfAKQ8CTtXxwdK+aA 1iJjDjEEl/uzixbt3SaytuDUSxWO9Fyt4mkKfAUoCLqWLjhLgy28ThZfwOLAJrUjwdvn 6uztb96mwRPvvaABYS305ptaZDoW3IntCND7aJ0qdTozM80GQM5fOQXAx13rJBU5Bmdv S3cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nL+GqAVX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i22-20020a17090acf9600b001dd100aad89si2383017pju.79.2022.05.18.03.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 03:24:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nL+GqAVX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEC876F4B7; Wed, 18 May 2022 03:05:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234810AbiERKFB (ORCPT + 99 others); Wed, 18 May 2022 06:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234732AbiERKE7 (ORCPT ); Wed, 18 May 2022 06:04:59 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11A8663E6; Wed, 18 May 2022 03:04:56 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 6F3FBFF817; Wed, 18 May 2022 10:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652868295; 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=q7m8azLqYxqw7exPiKwgRaIReLLbq6ltOL8jkRp0nlI=; b=nL+GqAVXrAO7B3g8JVROmVVyCKbDKBByNZl/NoWgXswcrfz+/eW1k7H9Obk2ZeASUbEREJ 0o8xljT9DvNrAzupsqYy+CFEMAz0Ec3LndbkgMGD1IDg0qW8qVMP5pIs0EdXj+jCVc3KFq xVTTjXnQH5xmn9xR4TZ/zlUMVty4mGq8DZ5HjaTgLH0sVr0N3bGYNG+aPcop/sdP8SIQzc Q8fPXaAvm/+72BBhaua5YhhEjc2C06es7bgGCt1pDfZNsgeqXNLL3x3iyzIJ/uxHpIWAiq 1KVWtuKbYHpw9H5dcXyeRgTT4mqi0qUAiaIlY6UOIahlLFwAw5kspTSZuizoHw== Date: Wed, 18 May 2022 12:03:40 +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: <20220518120340.61e8e11a@fixe.home> In-Reply-To: <30bb7968-06fb-308c-a5f0-df316dfb240e@gmail.com> References: <20220427094502.456111-1-clement.leger@bootlin.com> <20220427094502.456111-2-clement.leger@bootlin.com> <20220517093729.214c33a3@fixe.home> <30bb7968-06fb-308c-a5f0-df316dfb240e@gmail.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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, 17 May 2022 11:03:41 -0400, Frank Rowand a =C3=A9crit : > On 5/17/22 02:37, Cl=C3=A9ment L=C3=A9ger wrote: > > Le Mon, 16 May 2022 23:11:03 -0400, > > Frank Rowand a =C3=A9crit : > > =20 > >> On 5/3/22 08:45, Rob Herring wrote: =20 > >>> On Wed, Apr 27, 2022 at 11:45:00AM +0200, Cl=C3=A9ment L=C3=A9ger wro= te: =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 > >>> > >>> 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_roo= t. > >>> > >>> I expect Frank will have some comments. =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)". =20 > >=20 > > 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: > >=20 > > / { > >=20 > > }; =20 >=20 > Yes. If you agree with this I can create a patch to implement it. I thi= nk > it is useful even stand alone from the rest of the series. If you want to implement this, feel free to do so, I'll (at least) be able to test it. >=20 > >=20 > > 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. =20 >=20 > No. Unittest does not create both of them (I'm pretty sure, but I'm not > going to double check). If I recall correctly, unittest adds a property > in one of those two nodes, and thus implicitly creates the node if not > already present. Unittest does populate internal pointers to those two > nodes if the nodes are present (otherwise the pointers will have the > value of null). There is no need for the nodes to be present if empty. Acked, makes sense. Cl=C3=A9ment >=20 > -Frank >=20 > >=20 > > Thanks, > >=20 > > Cl=C3=A9ment > > =20 > >> > >> unflatten_and_copy_device_tree() calls unittest_unflatten_overlay_base= () > >> after unflattening the device tree passed into the booting kernel. Th= is > >> step is needed for a specific portion of the unittests. > >> > >> 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. > >> > >> -Frank > >> =20 > >=20 > > =20 >=20 --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com