Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp139796iob; Tue, 17 May 2022 21:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDWzYJ5kkLnlJvCScUSnCLUHfi/0n4mjTgK3Ex9OmJzbCOKUEDjQHxfBe7Z5eaiTmjiBEV X-Received: by 2002:a17:903:110e:b0:15e:f450:bee8 with SMTP id n14-20020a170903110e00b0015ef450bee8mr25711412plh.136.1652848511920; Tue, 17 May 2022 21:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652848511; cv=none; d=google.com; s=arc-20160816; b=A2GoIiOouNUFSQRA/GHhPYOtdLQ0eHJnyIT/XgnEHcEvKNwlM9g9I/8z4N3R+Fr5/g JEHql4WK3/bfDtIL6/iC93pXfqRThgWRNvUXc+CN0baQ4+2nmvOjljsDDVASscpnevsf CoaYVafauYKhXgga1EWpS6/6sECCUAt2e7VC97cYOxlvCL+g4sJGeZMMIUA/RqVz8/SM ggwUc3/utBFjuj6I8AB5dNYMIklrBhvMlxR0Wv/f/wIjt4OtYjEk/XlKptnXxTnrlMt9 kheW9GihO7aii5qETl1pxuGtRe0sTTWvlWKqb9e54aLfAFesbAq6bzgW8fBnO5s/dDCy TTmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=S4e8UP5BJWcehEd5lvqnvGFisDV1bTubwTjUFBZmIpM=; b=crMuPF5Q2aJ200YpQ1OsQzr8NNcBwG4z5oWEbKuGEFXAndqUTPQf0Cn4+jBEkC4Y+e /7fIl4p3O+4r8mHNcO/mCvhbZreCC+rf0IbLIe8GhIUqLgKzmecFnJ/1KdCmuIPRo4/k ME+UpavS8nPEmdeilnRRtLgDTf1z5WpYViK70O1UNPVQDNgoveyNd6gu58uGReaX/kE3 duXhgJuUv5GjVCFv9nQg6fr2NjaJ0rrbc10eLwo75JmSpPowdb7vfVkI2NbJFxYM5SBN DvSsNdvagsP0yOjcLeZArjv3QgYAmzl4MO02XE8/R3tUEozfHQoH+9eO3AA8E63Q2s0g oIjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=it+A4dqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b16-20020a056a000a9000b004fa5a66305esi1990165pfl.36.2022.05.17.21.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=it+A4dqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF47FB36FB; Tue, 17 May 2022 20:53:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349591AbiEQPDt (ORCPT + 99 others); Tue, 17 May 2022 11:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349545AbiEQPDq (ORCPT ); Tue, 17 May 2022 11:03:46 -0400 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99124286F1; Tue, 17 May 2022 08:03:45 -0700 (PDT) Received: by mail-vs1-xe33.google.com with SMTP id q2so18969190vsr.5; Tue, 17 May 2022 08:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=S4e8UP5BJWcehEd5lvqnvGFisDV1bTubwTjUFBZmIpM=; b=it+A4dqWumEFH1OSAjnGrn0chRuB/5FpiUDVDsQus4pGIE77uwkNPajTFqp43yaQQV 0K4FVAfDKxGbfdWuXwGMuG7OWRggbGm9UcyR6gkdkalqgO7NTI8voWH0N6d7cHwOuPLb tAwe5tmJsOrauX8ChVqllBdIg4J3215TuS3u6DcHR4ERrH0PN+5+kH7m93V1Cye9CgP+ vUeIStn210AYuqJef07EjLTloaNfpoPGmO2ohlLbpqZ8tzNhJ+mEmaAVYk7w2HQe2lqo 29xH4Y+sUjHCMOxqVITXcyH9o5Ob+H1KoW7qMDLlKIeQsHopFS681ikGrcVWoXCqVTOv JKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=S4e8UP5BJWcehEd5lvqnvGFisDV1bTubwTjUFBZmIpM=; b=Ixa3kqQJh7u+rcI8FT00j7ISHXObOAuEOvDw2JNo+O7PVH+hZuH5wdbbubopfMl6z9 +faYjoycZ0+OoE1NvLm7OBai0h5blQhD84sqSq5n2Xko2XO/OlaZH0IqFQ1CvLGiwJ6J bNKJLNDMqedaOKX258T4uR7EckLhzTV0S4Sy3LJbPdkZ2tTDrp9AEw7CH+tpZXnV61Y0 PL7c2ickuhzKeqb65xbapHLTiD8qEk9AezxP3GhAgPU1hYVqpk2tMYCMIA3nIMkvqkM+ yjiwe+v1IG2pPVzai7yDMAFjbrW5QAdgpIKFX0e4EnNBiJCRd8QPKVuX91nxGePbyTn7 GlwA== X-Gm-Message-State: AOAM532WFodYtpWp+320nPRJ9k19+i3BiljLlHNer1nDvUW/bHXDdEyK 0NENvGddh9kslkksnb5jV5I= X-Received: by 2002:a05:6102:548a:b0:32d:8c72:ee18 with SMTP id bk10-20020a056102548a00b0032d8c72ee18mr9187660vsb.70.1652799824751; Tue, 17 May 2022 08:03:44 -0700 (PDT) Received: from [192.168.1.140] ([65.35.200.237]) by smtp.gmail.com with ESMTPSA id b20-20020a056102233400b0032d275e6922sm1207602vsa.34.2022.05.17.08.03.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 08:03:44 -0700 (PDT) Message-ID: <30bb7968-06fb-308c-a5f0-df316dfb240e@gmail.com> Date: Tue, 17 May 2022 11:03:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 1/3] of: always populate a root node Content-Language: en-US To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= 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 References: <20220427094502.456111-1-clement.leger@bootlin.com> <20220427094502.456111-2-clement.leger@bootlin.com> <20220517093729.214c33a3@fixe.home> From: Frank Rowand In-Reply-To: <20220517093729.214c33a3@fixe.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 5/17/22 02:37, Clément Léger wrote: > Le Mon, 16 May 2022 23:11:03 -0400, > Frank Rowand a écrit : > >> On 5/3/22 08:45, Rob Herring wrote: >>> On Wed, Apr 27, 2022 at 11:45:00AM +0200, Clément Léger wrote: >>>> 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. >>> >>> The existing unittest essentially does the same thing for running the >>> tests on non-DT systems. It should be modified to use this support >>> instead. Maybe that's just removing the unittest code that set of_root. >>> >>> I expect Frank will have some comments. >> >> 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: > > / { > > }; Yes. If you agree with this I can create a patch to implement it. I think it is useful even stand alone from the rest of the series. > > 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. 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. -Frank > > Thanks, > > Clément > >> >> 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. >> >> 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 >> > >