linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Frank Rowand <frowand.list@gmail.com>
Cc: SoC Team <soc@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Tim Harvey <tharvey@gateworks.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Li Yang <leoyang.li@nxp.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Michal Simek <monstr@monstr.eu>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Michael Walle <michael@walle.cc>,
	Alex Marginean <alexandru.marginean@nxp.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Dong Aisheng <aisheng.dong@nxp.com>,
	Jason Liu <jason.hui.liu@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	PCI <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] of: overlay: rename overlay source files from .dts to .dtso
Date: Mon, 9 May 2022 17:11:51 -0500	[thread overview]
Message-ID: <YnmRp8zMRr2RQ8W/@robh.at.kernel.org> (raw)
In-Reply-To: <dcf137b0-9f5c-07b5-e348-a99060136511@gmail.com>

On Wed, May 04, 2022 at 04:40:30PM -0500, Frank Rowand wrote:
> On 5/4/22 16:08, Rob Herring wrote:
> > On Wed, May 4, 2022 at 3:42 PM Frank Rowand <frowand.list@gmail.com> wrote:
> >>
> >> On 5/3/22 16:42, Rob Herring wrote:
> >>> On Tue, May 3, 2022 at 4:20 PM <frowand.list@gmail.com> wrote:
> >>>>
> >>>> From: Frank Rowand <frank.rowand@sony.com>
> >>>>
> >>>> In drivers/of/unittest-data/:
> >>>>    - Rename .dts overlay source files to use .dtso suffix.
> >>>>    - Add Makefile rule to build .dtbo.o assembly file from overlay
> >>>>      .dtso source file.
> >>>>    - Update Makefile to build .dtbo.o objects instead of .dtb.o from
> >>>>      unittest overlay source files.
> >>>>
> >>>> Modify driver/of/unitest.c to use .dtbo.o based symbols instead of
> >>>> .dtb.o
> >>>>
> >>>> Modify scripts/Makefile.lib %.dtbo rule to depend upon %.dtso instead
> >>>> of %.dts
> >>>>
> >>>> Rename .dts overlay source files to use .dtso suffix in:
> >>>>    arch/arm64/boot/dts/freescale/
> >>>>    arch/arm64/boot/dts/xilinx/
> >>>>
> >>>> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> >>>> ---
> >>>>
> >>>> Testing by arm64 people would be much appreciated.
> >>>>
> >>>> Applies on branch dt/next, commit 4fb74186cee8 of Rob's kernel.org tree.
> >>>> git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
> >>>>
> >>>> version 1 patch:
> >>>>    https://lore.kernel.org/r/20210324223713.1334666-1-frowand.list@gmail.com
> >>>>
> >>>> changes from version 1:
> >>>>    - rebase to 5.18-rc1 plus many patches already accepted by Rob
> >>>>      Applies on branch dt/next, commit 4fb74186cee8 of Rob's kernel.org tree.
> >>>>    - Add new overlay source files in:
> >>>>       arch/arm64/boot/dts/freescale/
> >>>>       arch/arm64/boot/dts/xilinx/
> >>>
> >>> I can't apply these. They need to be applied separately. And probably
> >>> at end of the merge window or right after rc1 (IOW, coordinated with
> >>> SoC maintainers in advance). Or we support both forms for a cycle.
> >>
> >> If applied separately then git bisect is broken.  I don't see this change
> >> as being big enough to be considered a "flag day" change, but if I can't
> >> get the SoC maintainers to ack you pulling these renames then I can easily
> >> re-spin in a way to support both forms for a release cycle.
> >>
> >>>
> >>> [...]
> >>>
> >>>> diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile
> >>>> index d072f3ba3971..df2ca1820273 100644
> >>>> --- a/drivers/of/unittest-data/Makefile
> >>>> +++ b/drivers/of/unittest-data/Makefile
> >>>> @@ -1,38 +1,58 @@
> >>>>  # SPDX-License-Identifier: GPL-2.0
> >>>> -obj-y += testcases.dtb.o
> >>>>
> >>>> -obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \
> >>>> -                           overlay_0.dtb.o \
> >>>> -                           overlay_1.dtb.o \
> >>>> -                           overlay_2.dtb.o \
> >>>> -                           overlay_3.dtb.o \
> >>>> -                           overlay_4.dtb.o \
> >>>> -                           overlay_5.dtb.o \
> >>>> -                           overlay_6.dtb.o \
> >>>> -                           overlay_7.dtb.o \
> >>>> -                           overlay_8.dtb.o \
> >>>> -                           overlay_9.dtb.o \
> >>>> -                           overlay_10.dtb.o \
> >>>> -                           overlay_11.dtb.o \
> >>>> -                           overlay_12.dtb.o \
> >>>> -                           overlay_13.dtb.o \
> >>>> -                           overlay_15.dtb.o \
> >>>> -                           overlay_16.dtb.o \
> >>>> -                           overlay_17.dtb.o \
> >>>> -                           overlay_18.dtb.o \
> >>>> -                           overlay_19.dtb.o \
> >>>> -                           overlay_20.dtb.o \
> >>>> -                           overlay_bad_add_dup_node.dtb.o \
> >>>> -                           overlay_bad_add_dup_prop.dtb.o \
> >>>> -                           overlay_bad_phandle.dtb.o \
> >>>> -                           overlay_bad_symbol.dtb.o \
> >>>> -                           overlay_base.dtb.o \
> >>>> -                           overlay_gpio_01.dtb.o \
> >>>> -                           overlay_gpio_02a.dtb.o \
> >>>> -                           overlay_gpio_02b.dtb.o \
> >>>> -                           overlay_gpio_03.dtb.o \
> >>>> -                           overlay_gpio_04a.dtb.o \
> >>>> -                           overlay_gpio_04b.dtb.o
> >>>> +# Generate an assembly file to wrap the output of the device tree compiler
> >>>> +quiet_cmd_dt_S_dtbo= DTB     $@
> >>>> +cmd_dt_S_dtbo=\
> >>>> +{                                                      \
> >>>> +       echo '\#include <asm-generic/vmlinux.lds.h>';   \
> >>>> +       echo '.section .dtb.init.rodata,"a"';           \
> >>>> +       echo '.balign STRUCT_ALIGNMENT';                \
> >>>> +       echo '.global __dtbo_$(subst -,_,$(*F))_begin'; \
> >>>> +       echo '__dtbo_$(subst -,_,$(*F))_begin:';        \
> >>>> +       echo '.incbin "$<" ';                           \
> >>>> +       echo '__dtbo_$(subst -,_,$(*F))_end:';          \
> >>>> +       echo '.global __dtbo_$(subst -,_,$(*F))_end';   \
> >>>> +       echo '.balign STRUCT_ALIGNMENT';                \
> >>>> +} > $@
> >>>> +
> >>>> +
> >>>> +$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
> >>>> +       $(call if_changed,dt_S_dtbo)
> >>>
> >>> Humm, this belongs in scripts/Makefile.lib.
> >>
> >> I would rather keep it isolated to just the use in unittest.
> >> We just now got rid of the final driver use of of_overlay_fdt_apply()
> >> by the grandfathered legacy user in:
> >>
> >>    841281fe52a7 drm: rcar-du: Drop LVDS device tree backward compatibility
> >>
> >> That driver was the only use of %.dtb.S for an overlay.
> > 
> > I'd actually prefer more drivers handling compatibility this way than
> > handling old and new DTs in code. That's easier to find and when
> > compatibility with old DTs is no longer needed we can just remove the
> > fixup overlay. Though I guess that one was a lot of code too, but that
> > would probably be mitigated if we had multiple users. Anyways, that's
> > a side issue.
> 
> If I remember correctly, that is a total reversal of previous discussions
> and policy decisions.

I don't think so.

> My previous position has been to not have drivers applying overlays.
> I'll have to step back and revisit the concept, trying to set aside
> my previous assumptions and conclusions.

If not drivers, who can? As I said in the other thread, I don't think a 
general mechanism will ever happen. Though a general mechanism with 
constraints (such as drivers registering target nodes which subtrees 
can be applied to) would be an implementation detail. Having constraints 
on what's allowed has been my position forever. In my mind, allowing 
overlays for specific drivers/subsystems is constrained, so maybe that's 
the confusion here.


> But before I go away and revisit, there is one thing to mention.  Now
> that you have machine parseable bindings (and many of them implemented)
> and also a method to statically validate overlays applied on top of
> specific base .dtbs (that is the purpose of the arch/arm64/dts/* files
> that I renamed in this patch, right?), allowing drivers to dynamically
> apply overlays, potentially after modifying the base devicetree (that's
> the other patch series I need to be reviewing at the moment...) reduces
> the validation coverage.

The bootloader can also do whatever modifications it wants too and 
that's not validated. However, we can run validation at build time and 
now on a running system, so at least the beginning and end states can be 
validated.

Rob

  reply	other threads:[~2022-05-09 22:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 21:19 [PATCH v2 1/1] of: overlay: rename overlay source files from .dts to .dtso frowand.list
2022-05-04  2:53 ` kernel test robot
     [not found] ` <CAL_JsqKqBWKWzQC1qXABuiC6b3OgwfO+c5-fpGz=AgSUSCHCcA@mail.gmail.com>
2022-05-04 20:42   ` Frank Rowand
     [not found]     ` <CAL_Jsq+YzYaQMrPjtp0yCRy0dqL2Me+GcLbmj_Drv=XVdvWqdw@mail.gmail.com>
2022-05-04 21:40       ` Frank Rowand
2022-05-09 22:11         ` Rob Herring [this message]
2022-07-07  7:21 ` Geert Uytterhoeven
2022-07-18 23:44   ` Frank Rowand
2022-09-20  8:58     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnmRp8zMRr2RQ8W/@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=aisheng.dong@nxp.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=ioana.ciornei@nxp.com \
    --cc=jason.hui.liu@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=soc@kernel.org \
    --cc=tharvey@gateworks.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).