mbox series

[v2,0/7] Rename DTB overlay source files

Message ID 20221024173434.32518-1-afd@ti.com
Headers show
Series Rename DTB overlay source files | expand

Message

Andrew Davis Oct. 24, 2022, 5:34 p.m. UTC
Hello all,

This is a series based on my patch here[0]. As suggested by Rob
I've resurrected Frank's patch and appended it to mine as a series.

First patch here is my original patch, 3rd is Frank's patch but with
the unittest changes pulled out into the 2nd patch. That was re-worked
moving the source building macro into scripts/Makefile.lib.

Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
overlays. Split out by platform so they could be taken by platform
maintainers or if easier ACK'd here and taken all together.

This should cover all the DTB overlays so we can remove the old .dts
rule for overlays and make .dtso the only supported way, let me know
if we want that this cycle and I can post that too.

Thanks,
Andrew

Changes from v1[1]:
 - Added patch to rename pi433 overlay.
 - Cleaned wording on patch 4-6.
 - Collected some ACKs

[0] https://www.spinics.net/lists/kernel/msg4548509.html
[1] https://www.spinics.net/lists/arm-kernel/msg1020165.html

Andrew Davis (6):
  kbuild: Allow DTB overlays to built from .dtso named source files
  kbuild: Allow DTB overlays to built into .dtso.S files
  arm64: dts: freescale: Rename DTB overlay source files from .dts to
    .dtso
  arm64: dts: renesas: Rename DTB overlay source files from .dts to
    .dtso
  arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
  staging: pi433: overlay: Rename overlay source file from .dts to .dtso

Frank Rowand (1):
  of: overlay: rename overlay source files from .dts to .dtso

 ...qds-13bb.dts => fsl-ls1028a-qds-13bb.dtso} |  0
 ...qds-65bb.dts => fsl-ls1028a-qds-65bb.dtso} |  0
 ...qds-7777.dts => fsl-ls1028a-qds-7777.dtso} |  0
 ...qds-85bb.dts => fsl-ls1028a-qds-85bb.dtso} |  0
 ...qds-899b.dts => fsl-ls1028a-qds-899b.dtso} |  0
 ...qds-9999.dts => fsl-ls1028a-qds-9999.dtso} |  0
 ...ts => imx8mm-venice-gw72xx-0x-imx219.dtso} |  0
 ...=> imx8mm-venice-gw72xx-0x-rs232-rts.dtso} |  0
 ...dts => imx8mm-venice-gw72xx-0x-rs422.dtso} |  0
 ...dts => imx8mm-venice-gw72xx-0x-rs485.dtso} |  0
 ...ts => imx8mm-venice-gw73xx-0x-imx219.dtso} |  0
 ...=> imx8mm-venice-gw73xx-0x-rs232-rts.dtso} |  0
 ...dts => imx8mm-venice-gw73xx-0x-rs422.dtso} |  0
 ...dts => imx8mm-venice-gw73xx-0x-rs485.dtso} |  0
 ...2.dts => draak-ebisu-panel-aa104xd12.dtso} |  0
 ...xd12.dts => salvator-panel-aa104xd12.dtso} |  0
 ...v-g-revA.dts => zynqmp-sck-kv-g-revA.dtso} |  0
 ...v-g-revB.dts => zynqmp-sck-kv-g-revB.dtso} |  0
 drivers/of/unittest-data/Makefile             | 66 +++++++++----------
 .../{overlay.dts => overlay.dtso}             |  0
 .../{overlay_0.dts => overlay_0.dtso}         |  0
 .../{overlay_1.dts => overlay_1.dtso}         |  0
 .../{overlay_10.dts => overlay_10.dtso}       |  0
 .../{overlay_11.dts => overlay_11.dtso}       |  0
 .../{overlay_12.dts => overlay_12.dtso}       |  0
 .../{overlay_13.dts => overlay_13.dtso}       |  0
 .../{overlay_15.dts => overlay_15.dtso}       |  0
 .../{overlay_16.dts => overlay_16.dtso}       |  0
 .../{overlay_17.dts => overlay_17.dtso}       |  0
 .../{overlay_18.dts => overlay_18.dtso}       |  0
 .../{overlay_19.dts => overlay_19.dtso}       |  0
 .../{overlay_2.dts => overlay_2.dtso}         |  0
 .../{overlay_20.dts => overlay_20.dtso}       |  0
 .../{overlay_3.dts => overlay_3.dtso}         |  0
 .../{overlay_4.dts => overlay_4.dtso}         |  0
 .../{overlay_5.dts => overlay_5.dtso}         |  0
 .../{overlay_6.dts => overlay_6.dtso}         |  0
 .../{overlay_7.dts => overlay_7.dtso}         |  0
 .../{overlay_8.dts => overlay_8.dtso}         |  0
 .../{overlay_9.dts => overlay_9.dtso}         |  0
 ...node.dts => overlay_bad_add_dup_node.dtso} |  0
 ...prop.dts => overlay_bad_add_dup_prop.dtso} |  0
 ...d_phandle.dts => overlay_bad_phandle.dtso} |  0
 ...bad_symbol.dts => overlay_bad_symbol.dtso} |  0
 .../{overlay_base.dts => overlay_base.dtso}   |  0
 ...erlay_gpio_01.dts => overlay_gpio_01.dtso} |  0
 ...lay_gpio_02a.dts => overlay_gpio_02a.dtso} |  0
 ...lay_gpio_02b.dts => overlay_gpio_02b.dtso} |  0
 ...erlay_gpio_03.dts => overlay_gpio_03.dtso} |  0
 ...lay_gpio_04a.dts => overlay_gpio_04a.dtso} |  0
 ...lay_gpio_04b.dts => overlay_gpio_04b.dtso} |  0
 .../{testcases.dts => testcases.dtso}         |  0
 drivers/of/unittest.c                         | 48 +++++++-------
 .../{pi433-overlay.dts => pi433-overlay.dtso} |  0
 .../pi433/Documentation/devicetree/pi433.txt  |  6 +-
 scripts/Makefile.lib                          | 23 ++++++-
 56 files changed, 82 insertions(+), 61 deletions(-)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-13bb.dts => fsl-ls1028a-qds-13bb.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-65bb.dts => fsl-ls1028a-qds-65bb.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-7777.dts => fsl-ls1028a-qds-7777.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-85bb.dts => fsl-ls1028a-qds-85bb.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-899b.dts => fsl-ls1028a-qds-899b.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-9999.dts => fsl-ls1028a-qds-9999.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-imx219.dts => imx8mm-venice-gw72xx-0x-imx219.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs232-rts.dts => imx8mm-venice-gw72xx-0x-rs232-rts.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs422.dts => imx8mm-venice-gw72xx-0x-rs422.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs485.dts => imx8mm-venice-gw72xx-0x-rs485.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-imx219.dts => imx8mm-venice-gw73xx-0x-imx219.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs232-rts.dts => imx8mm-venice-gw73xx-0x-rs232-rts.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs422.dts => imx8mm-venice-gw73xx-0x-rs422.dtso} (100%)
 rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs485.dts => imx8mm-venice-gw73xx-0x-rs485.dtso} (100%)
 rename arch/arm64/boot/dts/renesas/{draak-ebisu-panel-aa104xd12.dts => draak-ebisu-panel-aa104xd12.dtso} (100%)
 rename arch/arm64/boot/dts/renesas/{salvator-panel-aa104xd12.dts => salvator-panel-aa104xd12.dtso} (100%)
 rename arch/arm64/boot/dts/xilinx/{zynqmp-sck-kv-g-revA.dts => zynqmp-sck-kv-g-revA.dtso} (100%)
 rename arch/arm64/boot/dts/xilinx/{zynqmp-sck-kv-g-revB.dts => zynqmp-sck-kv-g-revB.dtso} (100%)
 rename drivers/of/unittest-data/{overlay.dts => overlay.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_0.dts => overlay_0.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_1.dts => overlay_1.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_10.dts => overlay_10.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_11.dts => overlay_11.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_12.dts => overlay_12.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_13.dts => overlay_13.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_15.dts => overlay_15.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_16.dts => overlay_16.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_17.dts => overlay_17.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_18.dts => overlay_18.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_19.dts => overlay_19.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_2.dts => overlay_2.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_20.dts => overlay_20.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_3.dts => overlay_3.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_4.dts => overlay_4.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_5.dts => overlay_5.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_6.dts => overlay_6.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_7.dts => overlay_7.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_8.dts => overlay_8.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_9.dts => overlay_9.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_bad_add_dup_node.dts => overlay_bad_add_dup_node.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_bad_add_dup_prop.dts => overlay_bad_add_dup_prop.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_bad_phandle.dts => overlay_bad_phandle.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_bad_symbol.dts => overlay_bad_symbol.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_base.dts => overlay_base.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_01.dts => overlay_gpio_01.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_02a.dts => overlay_gpio_02a.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_02b.dts => overlay_gpio_02b.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_03.dts => overlay_gpio_03.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_04a.dts => overlay_gpio_04a.dtso} (100%)
 rename drivers/of/unittest-data/{overlay_gpio_04b.dts => overlay_gpio_04b.dtso} (100%)
 rename drivers/of/unittest-data/{testcases.dts => testcases.dtso} (100%)
 rename drivers/staging/pi433/Documentation/devicetree/{pi433-overlay.dts => pi433-overlay.dtso} (100%)

Comments

Frank Rowand Oct. 24, 2022, 10:01 p.m. UTC | #1
On 10/24/22 12:34, Andrew Davis wrote:
> Currently DTB Overlays (.dtbo) are build from source files with the same
> extension (.dts) as the base DTs (.dtb). This may become confusing and
> even lead to wrong results. For example, a composite DTB (created from a
> base DTB and a set of overlays) might have the same name as one of the
> overlays that create it.
> 
> Different files should be generated from differently named sources.
>  .dtb  <-> .dts
>  .dtbo <-> .dtso
> 
> We do not remove the ability to compile DTBO files from .dts files here,
> only add a new rule allowing the .dtso file name. The current .dts named
> overlays can be renamed with time. After all have been renamed we can
> remove the other rule.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Tested-by: Frank Rowand <frowand.list@gmail.com>

-Frank


>  scripts/Makefile.lib | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 3aa384cec76b8..0376a6f18bfb1 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -408,6 +408,9 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
>  $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
>  	$(call if_changed_dep,dtc)
>  
> +$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
> +	$(call if_changed_dep,dtc)
> +
>  dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
>  
>  # Bzip2
Frank Rowand Oct. 24, 2022, 10:01 p.m. UTC | #2
On 10/24/22 12:34, Andrew Davis wrote:
> DTB files can be built into the kernel by converting them to assembly
> files then assembling them into object files. We extend this here
> for DTB overlays with the .dtso extensions.
> 
> We change the start and end delimiting tag prefix to make it clear that
> this data came from overlay files.
> 
> [Based on patch by Frank Rowand <frank.rowand@sony.com>]
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Tested-by: Frank Rowand <frowand.list@gmail.com>

-Frank


>  scripts/Makefile.lib | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 0376a6f18bfb1..250b9fd73f6d2 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -358,7 +358,7 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
>  DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
>  
>  # Generate an assembly file to wrap the output of the device tree compiler
> -quiet_cmd_dt_S_dtb= DTB     $@
> +quiet_cmd_dt_S_dtb= DTBS    $@
>  cmd_dt_S_dtb=						\
>  {							\
>  	echo '\#include <asm-generic/vmlinux.lds.h>'; 	\
> @@ -375,6 +375,24 @@ cmd_dt_S_dtb=						\
>  $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
>  	$(call if_changed,dt_S_dtb)
>  
> +# Generate an assembly file to wrap the output of the device tree compiler
> +quiet_cmd_dt_S_dtbo= DTBOS   $@
> +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)
> +
>  quiet_cmd_dtc = DTC     $@
>  cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
>  	$(DTC) -o $@ -b 0 \
Frank Rowand Oct. 24, 2022, 10:01 p.m. UTC | #3
On 10/24/22 12:34, Andrew Davis wrote:
> From: Frank Rowand <frank.rowand@sony.com>
> 
> In drivers/of/unittest-data/:
>    - Rename .dts overlay source files to use .dtso suffix.
> 
> Modify driver/of/unitest.c to use .dtbo.o based symbols instead of .dtb.o
> 
> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Tested-by: Frank Rowand <frowand.list@gmail.com>

-Frank


>  drivers/of/unittest-data/Makefile             | 66 +++++++++----------
>  .../{overlay.dts => overlay.dtso}             |  0
>  .../{overlay_0.dts => overlay_0.dtso}         |  0
>  .../{overlay_1.dts => overlay_1.dtso}         |  0
>  .../{overlay_10.dts => overlay_10.dtso}       |  0
>  .../{overlay_11.dts => overlay_11.dtso}       |  0
>  .../{overlay_12.dts => overlay_12.dtso}       |  0
>  .../{overlay_13.dts => overlay_13.dtso}       |  0
>  .../{overlay_15.dts => overlay_15.dtso}       |  0
>  .../{overlay_16.dts => overlay_16.dtso}       |  0
>  .../{overlay_17.dts => overlay_17.dtso}       |  0
>  .../{overlay_18.dts => overlay_18.dtso}       |  0
>  .../{overlay_19.dts => overlay_19.dtso}       |  0
>  .../{overlay_2.dts => overlay_2.dtso}         |  0
>  .../{overlay_20.dts => overlay_20.dtso}       |  0
>  .../{overlay_3.dts => overlay_3.dtso}         |  0
>  .../{overlay_4.dts => overlay_4.dtso}         |  0
>  .../{overlay_5.dts => overlay_5.dtso}         |  0
>  .../{overlay_6.dts => overlay_6.dtso}         |  0
>  .../{overlay_7.dts => overlay_7.dtso}         |  0
>  .../{overlay_8.dts => overlay_8.dtso}         |  0
>  .../{overlay_9.dts => overlay_9.dtso}         |  0
>  ...node.dts => overlay_bad_add_dup_node.dtso} |  0
>  ...prop.dts => overlay_bad_add_dup_prop.dtso} |  0
>  ...d_phandle.dts => overlay_bad_phandle.dtso} |  0
>  ...bad_symbol.dts => overlay_bad_symbol.dtso} |  0
>  .../{overlay_base.dts => overlay_base.dtso}   |  0
>  ...erlay_gpio_01.dts => overlay_gpio_01.dtso} |  0
>  ...lay_gpio_02a.dts => overlay_gpio_02a.dtso} |  0
>  ...lay_gpio_02b.dts => overlay_gpio_02b.dtso} |  0
>  ...erlay_gpio_03.dts => overlay_gpio_03.dtso} |  0
>  ...lay_gpio_04a.dts => overlay_gpio_04a.dtso} |  0
>  ...lay_gpio_04b.dts => overlay_gpio_04b.dtso} |  0
>  .../{testcases.dts => testcases.dtso}         |  0
>  drivers/of/unittest.c                         | 48 +++++++-------
>  35 files changed, 57 insertions(+), 57 deletions(-)
>  rename drivers/of/unittest-data/{overlay.dts => overlay.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_0.dts => overlay_0.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_1.dts => overlay_1.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_10.dts => overlay_10.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_11.dts => overlay_11.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_12.dts => overlay_12.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_13.dts => overlay_13.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_15.dts => overlay_15.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_16.dts => overlay_16.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_17.dts => overlay_17.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_18.dts => overlay_18.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_19.dts => overlay_19.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_2.dts => overlay_2.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_20.dts => overlay_20.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_3.dts => overlay_3.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_4.dts => overlay_4.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_5.dts => overlay_5.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_6.dts => overlay_6.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_7.dts => overlay_7.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_8.dts => overlay_8.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_9.dts => overlay_9.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_add_dup_node.dts => overlay_bad_add_dup_node.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_add_dup_prop.dts => overlay_bad_add_dup_prop.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_phandle.dts => overlay_bad_phandle.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_symbol.dts => overlay_bad_symbol.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_base.dts => overlay_base.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_01.dts => overlay_gpio_01.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_02a.dts => overlay_gpio_02a.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_02b.dts => overlay_gpio_02b.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_03.dts => overlay_gpio_03.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_04a.dts => overlay_gpio_04a.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_04b.dts => overlay_gpio_04b.dtso} (100%)
>  rename drivers/of/unittest-data/{testcases.dts => testcases.dtso} (100%)
> 
> diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile
> index d072f3ba39712..ea5f4da68e23a 100644
> --- a/drivers/of/unittest-data/Makefile
> +++ b/drivers/of/unittest-data/Makefile
> @@ -1,38 +1,38 @@
>  # SPDX-License-Identifier: GPL-2.0
> -obj-y += testcases.dtb.o
> +obj-y += testcases.dtbo.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
> +obj-$(CONFIG_OF_OVERLAY) += overlay.dtbo.o \
> +			    overlay_0.dtbo.o \
> +			    overlay_1.dtbo.o \
> +			    overlay_2.dtbo.o \
> +			    overlay_3.dtbo.o \
> +			    overlay_4.dtbo.o \
> +			    overlay_5.dtbo.o \
> +			    overlay_6.dtbo.o \
> +			    overlay_7.dtbo.o \
> +			    overlay_8.dtbo.o \
> +			    overlay_9.dtbo.o \
> +			    overlay_10.dtbo.o \
> +			    overlay_11.dtbo.o \
> +			    overlay_12.dtbo.o \
> +			    overlay_13.dtbo.o \
> +			    overlay_15.dtbo.o \
> +			    overlay_16.dtbo.o \
> +			    overlay_17.dtbo.o \
> +			    overlay_18.dtbo.o \
> +			    overlay_19.dtbo.o \
> +			    overlay_20.dtbo.o \
> +			    overlay_bad_add_dup_node.dtbo.o \
> +			    overlay_bad_add_dup_prop.dtbo.o \
> +			    overlay_bad_phandle.dtbo.o \
> +			    overlay_bad_symbol.dtbo.o \
> +			    overlay_base.dtbo.o \
> +			    overlay_gpio_01.dtbo.o \
> +			    overlay_gpio_02a.dtbo.o \
> +			    overlay_gpio_02b.dtbo.o \
> +			    overlay_gpio_03.dtbo.o \
> +			    overlay_gpio_04a.dtbo.o \
> +			    overlay_gpio_04b.dtbo.o
>  
>  # enable creation of __symbols__ node
>  DTC_FLAGS_overlay += -@
> diff --git a/drivers/of/unittest-data/overlay.dts b/drivers/of/unittest-data/overlay.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay.dts
> rename to drivers/of/unittest-data/overlay.dtso
> diff --git a/drivers/of/unittest-data/overlay_0.dts b/drivers/of/unittest-data/overlay_0.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_0.dts
> rename to drivers/of/unittest-data/overlay_0.dtso
> diff --git a/drivers/of/unittest-data/overlay_1.dts b/drivers/of/unittest-data/overlay_1.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_1.dts
> rename to drivers/of/unittest-data/overlay_1.dtso
> diff --git a/drivers/of/unittest-data/overlay_10.dts b/drivers/of/unittest-data/overlay_10.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_10.dts
> rename to drivers/of/unittest-data/overlay_10.dtso
> diff --git a/drivers/of/unittest-data/overlay_11.dts b/drivers/of/unittest-data/overlay_11.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_11.dts
> rename to drivers/of/unittest-data/overlay_11.dtso
> diff --git a/drivers/of/unittest-data/overlay_12.dts b/drivers/of/unittest-data/overlay_12.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_12.dts
> rename to drivers/of/unittest-data/overlay_12.dtso
> diff --git a/drivers/of/unittest-data/overlay_13.dts b/drivers/of/unittest-data/overlay_13.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_13.dts
> rename to drivers/of/unittest-data/overlay_13.dtso
> diff --git a/drivers/of/unittest-data/overlay_15.dts b/drivers/of/unittest-data/overlay_15.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_15.dts
> rename to drivers/of/unittest-data/overlay_15.dtso
> diff --git a/drivers/of/unittest-data/overlay_16.dts b/drivers/of/unittest-data/overlay_16.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_16.dts
> rename to drivers/of/unittest-data/overlay_16.dtso
> diff --git a/drivers/of/unittest-data/overlay_17.dts b/drivers/of/unittest-data/overlay_17.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_17.dts
> rename to drivers/of/unittest-data/overlay_17.dtso
> diff --git a/drivers/of/unittest-data/overlay_18.dts b/drivers/of/unittest-data/overlay_18.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_18.dts
> rename to drivers/of/unittest-data/overlay_18.dtso
> diff --git a/drivers/of/unittest-data/overlay_19.dts b/drivers/of/unittest-data/overlay_19.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_19.dts
> rename to drivers/of/unittest-data/overlay_19.dtso
> diff --git a/drivers/of/unittest-data/overlay_2.dts b/drivers/of/unittest-data/overlay_2.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_2.dts
> rename to drivers/of/unittest-data/overlay_2.dtso
> diff --git a/drivers/of/unittest-data/overlay_20.dts b/drivers/of/unittest-data/overlay_20.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_20.dts
> rename to drivers/of/unittest-data/overlay_20.dtso
> diff --git a/drivers/of/unittest-data/overlay_3.dts b/drivers/of/unittest-data/overlay_3.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_3.dts
> rename to drivers/of/unittest-data/overlay_3.dtso
> diff --git a/drivers/of/unittest-data/overlay_4.dts b/drivers/of/unittest-data/overlay_4.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_4.dts
> rename to drivers/of/unittest-data/overlay_4.dtso
> diff --git a/drivers/of/unittest-data/overlay_5.dts b/drivers/of/unittest-data/overlay_5.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_5.dts
> rename to drivers/of/unittest-data/overlay_5.dtso
> diff --git a/drivers/of/unittest-data/overlay_6.dts b/drivers/of/unittest-data/overlay_6.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_6.dts
> rename to drivers/of/unittest-data/overlay_6.dtso
> diff --git a/drivers/of/unittest-data/overlay_7.dts b/drivers/of/unittest-data/overlay_7.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_7.dts
> rename to drivers/of/unittest-data/overlay_7.dtso
> diff --git a/drivers/of/unittest-data/overlay_8.dts b/drivers/of/unittest-data/overlay_8.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_8.dts
> rename to drivers/of/unittest-data/overlay_8.dtso
> diff --git a/drivers/of/unittest-data/overlay_9.dts b/drivers/of/unittest-data/overlay_9.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_9.dts
> rename to drivers/of/unittest-data/overlay_9.dtso
> diff --git a/drivers/of/unittest-data/overlay_bad_add_dup_node.dts b/drivers/of/unittest-data/overlay_bad_add_dup_node.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_bad_add_dup_node.dts
> rename to drivers/of/unittest-data/overlay_bad_add_dup_node.dtso
> diff --git a/drivers/of/unittest-data/overlay_bad_add_dup_prop.dts b/drivers/of/unittest-data/overlay_bad_add_dup_prop.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_bad_add_dup_prop.dts
> rename to drivers/of/unittest-data/overlay_bad_add_dup_prop.dtso
> diff --git a/drivers/of/unittest-data/overlay_bad_phandle.dts b/drivers/of/unittest-data/overlay_bad_phandle.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_bad_phandle.dts
> rename to drivers/of/unittest-data/overlay_bad_phandle.dtso
> diff --git a/drivers/of/unittest-data/overlay_bad_symbol.dts b/drivers/of/unittest-data/overlay_bad_symbol.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_bad_symbol.dts
> rename to drivers/of/unittest-data/overlay_bad_symbol.dtso
> diff --git a/drivers/of/unittest-data/overlay_base.dts b/drivers/of/unittest-data/overlay_base.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_base.dts
> rename to drivers/of/unittest-data/overlay_base.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_01.dts b/drivers/of/unittest-data/overlay_gpio_01.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_01.dts
> rename to drivers/of/unittest-data/overlay_gpio_01.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_02a.dts b/drivers/of/unittest-data/overlay_gpio_02a.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_02a.dts
> rename to drivers/of/unittest-data/overlay_gpio_02a.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_02b.dts b/drivers/of/unittest-data/overlay_gpio_02b.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_02b.dts
> rename to drivers/of/unittest-data/overlay_gpio_02b.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_03.dts b/drivers/of/unittest-data/overlay_gpio_03.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_03.dts
> rename to drivers/of/unittest-data/overlay_gpio_03.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_04a.dts b/drivers/of/unittest-data/overlay_gpio_04a.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_04a.dts
> rename to drivers/of/unittest-data/overlay_gpio_04a.dtso
> diff --git a/drivers/of/unittest-data/overlay_gpio_04b.dts b/drivers/of/unittest-data/overlay_gpio_04b.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/overlay_gpio_04b.dts
> rename to drivers/of/unittest-data/overlay_gpio_04b.dtso
> diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dtso
> similarity index 100%
> rename from drivers/of/unittest-data/testcases.dts
> rename to drivers/of/unittest-data/testcases.dtso
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index b89ab5d9fea55..1d810c0e18f8c 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -1423,12 +1423,12 @@ static int __init unittest_data_add(void)
>  	void *unittest_data_align;
>  	struct device_node *unittest_data_node = NULL, *np;
>  	/*
> -	 * __dtb_testcases_begin[] and __dtb_testcases_end[] are magically
> -	 * created by cmd_dt_S_dtb in scripts/Makefile.lib
> +	 * __dtbo_testcases_begin[] and __dtbo_testcases_end[] are magically
> +	 * created by cmd_dt_S_dtbo in scripts/Makefile.lib
>  	 */
> -	extern uint8_t __dtb_testcases_begin[];
> -	extern uint8_t __dtb_testcases_end[];
> -	const int size = __dtb_testcases_end - __dtb_testcases_begin;
> +	extern uint8_t __dtbo_testcases_begin[];
> +	extern uint8_t __dtbo_testcases_end[];
> +	const int size = __dtbo_testcases_end - __dtbo_testcases_begin;
>  	int rc;
>  	void *ret;
>  
> @@ -1443,7 +1443,7 @@ static int __init unittest_data_add(void)
>  		return -ENOMEM;
>  
>  	unittest_data_align = PTR_ALIGN(unittest_data, FDT_ALIGN_SIZE);
> -	memcpy(unittest_data_align, __dtb_testcases_begin, size);
> +	memcpy(unittest_data_align, __dtbo_testcases_begin, size);
>  
>  	ret = of_fdt_unflatten_tree(unittest_data_align, NULL, &unittest_data_node);
>  	if (!ret) {
> @@ -3003,24 +3003,24 @@ static inline void __init of_unittest_overlay(void) { }
>  #ifdef CONFIG_OF_OVERLAY
>  
>  /*
> - * __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb
> - * in scripts/Makefile.lib
> + * __dtbo_##overlay_name##_begin[] and __dtbo_##overlay_name##_end[] are
> + * created by cmd_dt_S_dtbo in scripts/Makefile.lib
>   */
>  
> -#define OVERLAY_INFO_EXTERN(name) \
> -	extern uint8_t __dtb_##name##_begin[]; \
> -	extern uint8_t __dtb_##name##_end[]
> +#define OVERLAY_INFO_EXTERN(overlay_name) \
> +	extern uint8_t __dtbo_##overlay_name##_begin[]; \
> +	extern uint8_t __dtbo_##overlay_name##_end[]
>  
> -#define OVERLAY_INFO(overlay_name, expected)             \
> -{	.dtb_begin       = __dtb_##overlay_name##_begin, \
> -	.dtb_end         = __dtb_##overlay_name##_end,   \
> -	.expected_result = expected,                     \
> -	.name            = #overlay_name,                \
> +#define OVERLAY_INFO(overlay_name, expected) \
> +{	.dtbo_begin       = __dtbo_##overlay_name##_begin, \
> +	.dtbo_end         = __dtbo_##overlay_name##_end, \
> +	.expected_result = expected, \
> +	.name            = #overlay_name, \
>  }
>  
>  struct overlay_info {
> -	uint8_t		*dtb_begin;
> -	uint8_t		*dtb_end;
> +	uint8_t		*dtbo_begin;
> +	uint8_t		*dtbo_end;
>  	int		expected_result;
>  	int		ovcs_id;
>  	char		*name;
> @@ -3094,7 +3094,7 @@ static struct overlay_info overlays[] = {
>  	OVERLAY_INFO(overlay_bad_phandle, -EINVAL),
>  	OVERLAY_INFO(overlay_bad_symbol, -EINVAL),
>  	/* end marker */
> -	{.dtb_begin = NULL, .dtb_end = NULL, .expected_result = 0, .name = NULL}
> +	{.dtbo_begin = NULL, .dtbo_end = NULL, .expected_result = 0, .name = NULL}
>  };
>  
>  static struct device_node *overlay_base_root;
> @@ -3151,13 +3151,13 @@ void __init unittest_unflatten_overlay_base(void)
>  		return;
>  	}
>  
> -	data_size = info->dtb_end - info->dtb_begin;
> +	data_size = info->dtbo_end - info->dtbo_begin;
>  	if (!data_size) {
>  		pr_err("No dtb 'overlay_base' to attach\n");
>  		return;
>  	}
>  
> -	size = fdt_totalsize(info->dtb_begin);
> +	size = fdt_totalsize(info->dtbo_begin);
>  	if (size != data_size) {
>  		pr_err("dtb 'overlay_base' header totalsize != actual size");
>  		return;
> @@ -3169,7 +3169,7 @@ void __init unittest_unflatten_overlay_base(void)
>  		return;
>  	}
>  
> -	memcpy(new_fdt, info->dtb_begin, size);
> +	memcpy(new_fdt, info->dtbo_begin, size);
>  
>  	__unflatten_device_tree(new_fdt, NULL, &overlay_base_root,
>  				dt_alloc_memory, true);
> @@ -3204,11 +3204,11 @@ static int __init overlay_data_apply(const char *overlay_name, int *ovcs_id)
>  		return 0;
>  	}
>  
> -	size = info->dtb_end - info->dtb_begin;
> +	size = info->dtbo_end - info->dtbo_begin;
>  	if (!size)
>  		pr_err("no overlay data for %s\n", overlay_name);
>  
> -	ret = of_overlay_fdt_apply(info->dtb_begin, size, &info->ovcs_id);
> +	ret = of_overlay_fdt_apply(info->dtbo_begin, size, &info->ovcs_id);
>  	if (ovcs_id)
>  		*ovcs_id = info->ovcs_id;
>  	if (ret < 0)
Frank Rowand Oct. 24, 2022, 10:04 p.m. UTC | #4
Hi Andrew,

On 10/24/22 12:34, Andrew Davis wrote:
> Hello all,
> 
> This is a series based on my patch here[0]. As suggested by Rob
> I've resurrected Frank's patch and appended it to mine as a series.
> 
> First patch here is my original patch, 3rd is Frank's patch but with
> the unittest changes pulled out into the 2nd patch. That was re-worked
> moving the source building macro into scripts/Makefile.lib.
> 
> Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> overlays. Split out by platform so they could be taken by platform
> maintainers or if easier ACK'd here and taken all together.
> 
> This should cover all the DTB overlays so we can remove the old .dts
> rule for overlays and make .dtso the only supported way, let me know
> if we want that this cycle and I can post that too.

Thanks for picking this up and moving it forward.  I've reviewed patches
1 - 3, and took a quick look at 4 - 7 (which also look fine at a glance).

-Frank

> 
> Thanks,
> Andrew
> 
> Changes from v1[1]:
>  - Added patch to rename pi433 overlay.
>  - Cleaned wording on patch 4-6.
>  - Collected some ACKs
> 
> [0] https://www.spinics.net/lists/kernel/msg4548509.html
> [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> 
> Andrew Davis (6):
>   kbuild: Allow DTB overlays to built from .dtso named source files
>   kbuild: Allow DTB overlays to built into .dtso.S files
>   arm64: dts: freescale: Rename DTB overlay source files from .dts to
>     .dtso
>   arm64: dts: renesas: Rename DTB overlay source files from .dts to
>     .dtso
>   arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
>   staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> 
> Frank Rowand (1):
>   of: overlay: rename overlay source files from .dts to .dtso
> 
>  ...qds-13bb.dts => fsl-ls1028a-qds-13bb.dtso} |  0
>  ...qds-65bb.dts => fsl-ls1028a-qds-65bb.dtso} |  0
>  ...qds-7777.dts => fsl-ls1028a-qds-7777.dtso} |  0
>  ...qds-85bb.dts => fsl-ls1028a-qds-85bb.dtso} |  0
>  ...qds-899b.dts => fsl-ls1028a-qds-899b.dtso} |  0
>  ...qds-9999.dts => fsl-ls1028a-qds-9999.dtso} |  0
>  ...ts => imx8mm-venice-gw72xx-0x-imx219.dtso} |  0
>  ...=> imx8mm-venice-gw72xx-0x-rs232-rts.dtso} |  0
>  ...dts => imx8mm-venice-gw72xx-0x-rs422.dtso} |  0
>  ...dts => imx8mm-venice-gw72xx-0x-rs485.dtso} |  0
>  ...ts => imx8mm-venice-gw73xx-0x-imx219.dtso} |  0
>  ...=> imx8mm-venice-gw73xx-0x-rs232-rts.dtso} |  0
>  ...dts => imx8mm-venice-gw73xx-0x-rs422.dtso} |  0
>  ...dts => imx8mm-venice-gw73xx-0x-rs485.dtso} |  0
>  ...2.dts => draak-ebisu-panel-aa104xd12.dtso} |  0
>  ...xd12.dts => salvator-panel-aa104xd12.dtso} |  0
>  ...v-g-revA.dts => zynqmp-sck-kv-g-revA.dtso} |  0
>  ...v-g-revB.dts => zynqmp-sck-kv-g-revB.dtso} |  0
>  drivers/of/unittest-data/Makefile             | 66 +++++++++----------
>  .../{overlay.dts => overlay.dtso}             |  0
>  .../{overlay_0.dts => overlay_0.dtso}         |  0
>  .../{overlay_1.dts => overlay_1.dtso}         |  0
>  .../{overlay_10.dts => overlay_10.dtso}       |  0
>  .../{overlay_11.dts => overlay_11.dtso}       |  0
>  .../{overlay_12.dts => overlay_12.dtso}       |  0
>  .../{overlay_13.dts => overlay_13.dtso}       |  0
>  .../{overlay_15.dts => overlay_15.dtso}       |  0
>  .../{overlay_16.dts => overlay_16.dtso}       |  0
>  .../{overlay_17.dts => overlay_17.dtso}       |  0
>  .../{overlay_18.dts => overlay_18.dtso}       |  0
>  .../{overlay_19.dts => overlay_19.dtso}       |  0
>  .../{overlay_2.dts => overlay_2.dtso}         |  0
>  .../{overlay_20.dts => overlay_20.dtso}       |  0
>  .../{overlay_3.dts => overlay_3.dtso}         |  0
>  .../{overlay_4.dts => overlay_4.dtso}         |  0
>  .../{overlay_5.dts => overlay_5.dtso}         |  0
>  .../{overlay_6.dts => overlay_6.dtso}         |  0
>  .../{overlay_7.dts => overlay_7.dtso}         |  0
>  .../{overlay_8.dts => overlay_8.dtso}         |  0
>  .../{overlay_9.dts => overlay_9.dtso}         |  0
>  ...node.dts => overlay_bad_add_dup_node.dtso} |  0
>  ...prop.dts => overlay_bad_add_dup_prop.dtso} |  0
>  ...d_phandle.dts => overlay_bad_phandle.dtso} |  0
>  ...bad_symbol.dts => overlay_bad_symbol.dtso} |  0
>  .../{overlay_base.dts => overlay_base.dtso}   |  0
>  ...erlay_gpio_01.dts => overlay_gpio_01.dtso} |  0
>  ...lay_gpio_02a.dts => overlay_gpio_02a.dtso} |  0
>  ...lay_gpio_02b.dts => overlay_gpio_02b.dtso} |  0
>  ...erlay_gpio_03.dts => overlay_gpio_03.dtso} |  0
>  ...lay_gpio_04a.dts => overlay_gpio_04a.dtso} |  0
>  ...lay_gpio_04b.dts => overlay_gpio_04b.dtso} |  0
>  .../{testcases.dts => testcases.dtso}         |  0
>  drivers/of/unittest.c                         | 48 +++++++-------
>  .../{pi433-overlay.dts => pi433-overlay.dtso} |  0
>  .../pi433/Documentation/devicetree/pi433.txt  |  6 +-
>  scripts/Makefile.lib                          | 23 ++++++-
>  56 files changed, 82 insertions(+), 61 deletions(-)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-13bb.dts => fsl-ls1028a-qds-13bb.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-65bb.dts => fsl-ls1028a-qds-65bb.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-7777.dts => fsl-ls1028a-qds-7777.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-85bb.dts => fsl-ls1028a-qds-85bb.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-899b.dts => fsl-ls1028a-qds-899b.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{fsl-ls1028a-qds-9999.dts => fsl-ls1028a-qds-9999.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-imx219.dts => imx8mm-venice-gw72xx-0x-imx219.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs232-rts.dts => imx8mm-venice-gw72xx-0x-rs232-rts.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs422.dts => imx8mm-venice-gw72xx-0x-rs422.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw72xx-0x-rs485.dts => imx8mm-venice-gw72xx-0x-rs485.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-imx219.dts => imx8mm-venice-gw73xx-0x-imx219.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs232-rts.dts => imx8mm-venice-gw73xx-0x-rs232-rts.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs422.dts => imx8mm-venice-gw73xx-0x-rs422.dtso} (100%)
>  rename arch/arm64/boot/dts/freescale/{imx8mm-venice-gw73xx-0x-rs485.dts => imx8mm-venice-gw73xx-0x-rs485.dtso} (100%)
>  rename arch/arm64/boot/dts/renesas/{draak-ebisu-panel-aa104xd12.dts => draak-ebisu-panel-aa104xd12.dtso} (100%)
>  rename arch/arm64/boot/dts/renesas/{salvator-panel-aa104xd12.dts => salvator-panel-aa104xd12.dtso} (100%)
>  rename arch/arm64/boot/dts/xilinx/{zynqmp-sck-kv-g-revA.dts => zynqmp-sck-kv-g-revA.dtso} (100%)
>  rename arch/arm64/boot/dts/xilinx/{zynqmp-sck-kv-g-revB.dts => zynqmp-sck-kv-g-revB.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay.dts => overlay.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_0.dts => overlay_0.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_1.dts => overlay_1.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_10.dts => overlay_10.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_11.dts => overlay_11.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_12.dts => overlay_12.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_13.dts => overlay_13.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_15.dts => overlay_15.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_16.dts => overlay_16.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_17.dts => overlay_17.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_18.dts => overlay_18.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_19.dts => overlay_19.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_2.dts => overlay_2.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_20.dts => overlay_20.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_3.dts => overlay_3.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_4.dts => overlay_4.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_5.dts => overlay_5.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_6.dts => overlay_6.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_7.dts => overlay_7.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_8.dts => overlay_8.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_9.dts => overlay_9.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_add_dup_node.dts => overlay_bad_add_dup_node.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_add_dup_prop.dts => overlay_bad_add_dup_prop.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_phandle.dts => overlay_bad_phandle.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_bad_symbol.dts => overlay_bad_symbol.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_base.dts => overlay_base.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_01.dts => overlay_gpio_01.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_02a.dts => overlay_gpio_02a.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_02b.dts => overlay_gpio_02b.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_03.dts => overlay_gpio_03.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_04a.dts => overlay_gpio_04a.dtso} (100%)
>  rename drivers/of/unittest-data/{overlay_gpio_04b.dts => overlay_gpio_04b.dtso} (100%)
>  rename drivers/of/unittest-data/{testcases.dts => testcases.dtso} (100%)
>  rename drivers/staging/pi433/Documentation/devicetree/{pi433-overlay.dts => pi433-overlay.dtso} (100%)
>
Geert Uytterhoeven Oct. 25, 2022, 6:57 a.m. UTC | #5
On Mon, Oct 24, 2022 at 7:34 PM Andrew Davis <afd@ti.com> wrote:
> DTB Overlays (.dtbo) can now be built from source files with the
> extension (.dtso). This makes it clear what is the content of the files
> and differentiates them from base DTB source files.
>
> Rename the pi433-overlay.dts file to pi433-overlay.dtso and update
> the information file pi433.txt for the same.
>
> Signed-off-by: Andrew Davis <afd@ti.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Herring Oct. 26, 2022, 2:11 p.m. UTC | #6
On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
>
> Hello all,
>
> This is a series based on my patch here[0]. As suggested by Rob
> I've resurrected Frank's patch and appended it to mine as a series.
>
> First patch here is my original patch, 3rd is Frank's patch but with
> the unittest changes pulled out into the 2nd patch. That was re-worked
> moving the source building macro into scripts/Makefile.lib.
>
> Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> overlays. Split out by platform so they could be taken by platform
> maintainers or if easier ACK'd here and taken all together.
>
> This should cover all the DTB overlays so we can remove the old .dts
> rule for overlays and make .dtso the only supported way, let me know
> if we want that this cycle and I can post that too.
>
> Thanks,
> Andrew
>
> Changes from v1[1]:
>  - Added patch to rename pi433 overlay.
>  - Cleaned wording on patch 4-6.
>  - Collected some ACKs
>
> [0] https://www.spinics.net/lists/kernel/msg4548509.html
> [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
>
> Andrew Davis (6):
>   kbuild: Allow DTB overlays to built from .dtso named source files
>   kbuild: Allow DTB overlays to built into .dtso.S files
>   arm64: dts: freescale: Rename DTB overlay source files from .dts to
>     .dtso
>   arm64: dts: renesas: Rename DTB overlay source files from .dts to
>     .dtso
>   arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
>   staging: pi433: overlay: Rename overlay source file from .dts to .dtso
>
> Frank Rowand (1):
>   of: overlay: rename overlay source files from .dts to .dtso

I've applied patches 1-3 and 7. I'll send a PR for the branch to the
platform maintainers after a few days in linux-next.

Rob
Andy Shevchenko Nov. 11, 2022, 7:39 p.m. UTC | #7
On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> >
> > Hello all,
> >
> > This is a series based on my patch here[0]. As suggested by Rob
> > I've resurrected Frank's patch and appended it to mine as a series.
> >
> > First patch here is my original patch, 3rd is Frank's patch but with
> > the unittest changes pulled out into the 2nd patch. That was re-worked
> > moving the source building macro into scripts/Makefile.lib.
> >
> > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > overlays. Split out by platform so they could be taken by platform
> > maintainers or if easier ACK'd here and taken all together.
> >
> > This should cover all the DTB overlays so we can remove the old .dts
> > rule for overlays and make .dtso the only supported way, let me know
> > if we want that this cycle and I can post that too.
> >
> > Thanks,
> > Andrew
> >
> > Changes from v1[1]:
> >  - Added patch to rename pi433 overlay.
> >  - Cleaned wording on patch 4-6.
> >  - Collected some ACKs
> >
> > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> >
> > Andrew Davis (6):
> >   kbuild: Allow DTB overlays to built from .dtso named source files
> >   kbuild: Allow DTB overlays to built into .dtso.S files
> >   arm64: dts: freescale: Rename DTB overlay source files from .dts to
> >     .dtso
> >   arm64: dts: renesas: Rename DTB overlay source files from .dts to
> >     .dtso
> >   arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> >   staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> >
> > Frank Rowand (1):
> >   of: overlay: rename overlay source files from .dts to .dtso
> 
> I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> platform maintainers after a few days in linux-next.

The patch

commit 941214a512d8c80d47e720c17ec17e8539175e93
Author: Andrew Davis <afd@ti.com>
Date:   Mon Oct 24 12:34:29 2022 -0500

    kbuild: Allow DTB overlays to built into .dtbo.S files

broke the build reproducibility / no-op builds.

Before:
  2+ execution of `make` on non-changed tree did nothing

Now:
  Each run of `make` (even without a single bit changed) restarts vmlinux
  rebuild.

Please, revert or fix.
Andy Shevchenko Nov. 11, 2022, 7:40 p.m. UTC | #8
On Fri, Nov 11, 2022 at 09:39:57PM +0200, Andy Shevchenko wrote:
> On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > >
> > > Hello all,
> > >
> > > This is a series based on my patch here[0]. As suggested by Rob
> > > I've resurrected Frank's patch and appended it to mine as a series.
> > >
> > > First patch here is my original patch, 3rd is Frank's patch but with
> > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > moving the source building macro into scripts/Makefile.lib.
> > >
> > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > overlays. Split out by platform so they could be taken by platform
> > > maintainers or if easier ACK'd here and taken all together.
> > >
> > > This should cover all the DTB overlays so we can remove the old .dts
> > > rule for overlays and make .dtso the only supported way, let me know
> > > if we want that this cycle and I can post that too.
> > >
> > > Thanks,
> > > Andrew
> > >
> > > Changes from v1[1]:
> > >  - Added patch to rename pi433 overlay.
> > >  - Cleaned wording on patch 4-6.
> > >  - Collected some ACKs
> > >
> > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > >
> > > Andrew Davis (6):
> > >   kbuild: Allow DTB overlays to built from .dtso named source files
> > >   kbuild: Allow DTB overlays to built into .dtso.S files
> > >   arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > >     .dtso
> > >   arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > >     .dtso
> > >   arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > >   staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > >
> > > Frank Rowand (1):
> > >   of: overlay: rename overlay source files from .dts to .dtso
> > 
> > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > platform maintainers after a few days in linux-next.
> 
> The patch
> 
> commit 941214a512d8c80d47e720c17ec17e8539175e93
> Author: Andrew Davis <afd@ti.com>
> Date:   Mon Oct 24 12:34:29 2022 -0500
> 
>     kbuild: Allow DTB overlays to built into .dtbo.S files
> 
> broke the build reproducibility / no-op builds.
> 
> Before:
>   2+ execution of `make` on non-changed tree did nothing
> 
> Now:
>   Each run of `make` (even without a single bit changed) restarts vmlinux
>   rebuild.
> 
> Please, revert or fix.

git bisect start
# good: [f0c4d9fc9cc9462659728d168387191387e903cc] Linux 6.1-rc4
git bisect good f0c4d9fc9cc9462659728d168387191387e903cc
# bad: [f8f60f322f0640c8edda2942ca5f84b7a27c417a] Add linux-next specific files for 20221111
git bisect bad f8f60f322f0640c8edda2942ca5f84b7a27c417a
# good: [66500d0e2e5c9b64fc5d3f4879e2140572e1b386] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
git bisect good 66500d0e2e5c9b64fc5d3f4879e2140572e1b386
# bad: [080c1179d77ad36d6e51469b68801ef341ec292a] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
git bisect bad 080c1179d77ad36d6e51469b68801ef341ec292a
# good: [7f5ff6593cc1b1ec2442be30eaf043cf09fa9282] Merge branch 'for-next' of https://gitlab.freedesktop.org/drm/tegra.git
git bisect good 7f5ff6593cc1b1ec2442be30eaf043cf09fa9282
# good: [c16d93a496889347965a860dc4fe493b642f8aff] Merge branch 'for-next' of git://git.kernel.dk/linux-block.git
git bisect good c16d93a496889347965a860dc4fe493b642f8aff
# good: [c9ef15a7221d84edcf03b422ef0a4e43affda226] Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
git bisect good c9ef15a7221d84edcf03b422ef0a4e43affda226
# good: [736894df52110a9e2e106708d848ab08516e5910] Merge branch 'next/dt' into for-next
git bisect good 736894df52110a9e2e106708d848ab08516e5910
# good: [d19d44e32c93cfa815b22ee2254cd1f541a20116] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git
git bisect good d19d44e32c93cfa815b22ee2254cd1f541a20116
# good: [93cc2559d3fdcd28b1a7972ab519a6cd8ba20f9d] spi: Remove the obsolte u64_stats_fetch_*_irq() users.
git bisect good 93cc2559d3fdcd28b1a7972ab519a6cd8ba20f9d
# bad: [26c9134a370ace32cda7a3f9efaf4ca85e57ca8d] Merge branch 'dt/dtbo-rename' into dt/next
git bisect bad 26c9134a370ace32cda7a3f9efaf4ca85e57ca8d
# good: [c9adc3bd1180d2911d2b1b886dbec916805be998] dt-bindings: Remove "status" from schema examples, again
git bisect good c9adc3bd1180d2911d2b1b886dbec916805be998
# bad: [fa9665ef77f5d8e861e2ed7563ebdbddddc6f82b] staging: pi433: overlay: Rename overlay source file from .dts to .dtso
git bisect bad fa9665ef77f5d8e861e2ed7563ebdbddddc6f82b
# bad: [941214a512d8c80d47e720c17ec17e8539175e93] kbuild: Allow DTB overlays to built into .dtbo.S files
git bisect bad 941214a512d8c80d47e720c17ec17e8539175e93
# good: [363547d2191cbc32ca954ba75d72908712398ff2] kbuild: Allow DTB overlays to built from .dtso named source files
git bisect good 363547d2191cbc32ca954ba75d72908712398ff2
# first bad commit: [941214a512d8c80d47e720c17ec17e8539175e93] kbuild: Allow DTB overlays to built into .dtbo.S files
Andrew Davis Nov. 11, 2022, 9:05 p.m. UTC | #9
On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
>> On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
>>>
>>> Hello all,
>>>
>>> This is a series based on my patch here[0]. As suggested by Rob
>>> I've resurrected Frank's patch and appended it to mine as a series.
>>>
>>> First patch here is my original patch, 3rd is Frank's patch but with
>>> the unittest changes pulled out into the 2nd patch. That was re-worked
>>> moving the source building macro into scripts/Makefile.lib.
>>>
>>> Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
>>> overlays. Split out by platform so they could be taken by platform
>>> maintainers or if easier ACK'd here and taken all together.
>>>
>>> This should cover all the DTB overlays so we can remove the old .dts
>>> rule for overlays and make .dtso the only supported way, let me know
>>> if we want that this cycle and I can post that too.
>>>
>>> Thanks,
>>> Andrew
>>>
>>> Changes from v1[1]:
>>>   - Added patch to rename pi433 overlay.
>>>   - Cleaned wording on patch 4-6.
>>>   - Collected some ACKs
>>>
>>> [0] https://www.spinics.net/lists/kernel/msg4548509.html
>>> [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
>>>
>>> Andrew Davis (6):
>>>    kbuild: Allow DTB overlays to built from .dtso named source files
>>>    kbuild: Allow DTB overlays to built into .dtso.S files
>>>    arm64: dts: freescale: Rename DTB overlay source files from .dts to
>>>      .dtso
>>>    arm64: dts: renesas: Rename DTB overlay source files from .dts to
>>>      .dtso
>>>    arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
>>>    staging: pi433: overlay: Rename overlay source file from .dts to .dtso
>>>
>>> Frank Rowand (1):
>>>    of: overlay: rename overlay source files from .dts to .dtso
>>
>> I've applied patches 1-3 and 7. I'll send a PR for the branch to the
>> platform maintainers after a few days in linux-next.
> 
> The patch
> 
> commit 941214a512d8c80d47e720c17ec17e8539175e93
> Author: Andrew Davis <afd@ti.com>
> Date:   Mon Oct 24 12:34:29 2022 -0500
> 
>      kbuild: Allow DTB overlays to built into .dtbo.S files
> 
> broke the build reproducibility / no-op builds.
> 
> Before:
>    2+ execution of `make` on non-changed tree did nothing
> 
> Now:
>    Each run of `make` (even without a single bit changed) restarts vmlinux
>    rebuild.
> 
> Please, revert or fix.
> 

I do not see this behavior. What config are you using?

Not sure how this patch could be the root cause, it only adds
a build target/rule, but doesn't actually use it anywhere yet..

Andrew
Andy Shevchenko Nov. 13, 2022, 12:20 p.m. UTC | #10
On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
> On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> > On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > > > 
> > > > Hello all,
> > > > 
> > > > This is a series based on my patch here[0]. As suggested by Rob
> > > > I've resurrected Frank's patch and appended it to mine as a series.
> > > > 
> > > > First patch here is my original patch, 3rd is Frank's patch but with
> > > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > > moving the source building macro into scripts/Makefile.lib.
> > > > 
> > > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > > overlays. Split out by platform so they could be taken by platform
> > > > maintainers or if easier ACK'd here and taken all together.
> > > > 
> > > > This should cover all the DTB overlays so we can remove the old .dts
> > > > rule for overlays and make .dtso the only supported way, let me know
> > > > if we want that this cycle and I can post that too.
> > > > 
> > > > Thanks,
> > > > Andrew
> > > > 
> > > > Changes from v1[1]:
> > > >   - Added patch to rename pi433 overlay.
> > > >   - Cleaned wording on patch 4-6.
> > > >   - Collected some ACKs
> > > > 
> > > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > > > 
> > > > Andrew Davis (6):
> > > >    kbuild: Allow DTB overlays to built from .dtso named source files
> > > >    kbuild: Allow DTB overlays to built into .dtso.S files
> > > >    arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > > >      .dtso
> > > >    arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > > >      .dtso
> > > >    arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > > >    staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > > > 
> > > > Frank Rowand (1):
> > > >    of: overlay: rename overlay source files from .dts to .dtso
> > > 
> > > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > > platform maintainers after a few days in linux-next.
> > 
> > The patch
> > 
> > commit 941214a512d8c80d47e720c17ec17e8539175e93
> > Author: Andrew Davis <afd@ti.com>
> > Date:   Mon Oct 24 12:34:29 2022 -0500
> > 
> >      kbuild: Allow DTB overlays to built into .dtbo.S files
> > 
> > broke the build reproducibility / no-op builds.
> > 
> > Before:
> >    2+ execution of `make` on non-changed tree did nothing
> > 
> > Now:
> >    Each run of `make` (even without a single bit changed) restarts vmlinux
> >    rebuild.
> > 
> > Please, revert or fix.
> > 
> 
> I do not see this behavior. What config are you using?
> 
> Not sure how this patch could be the root cause, it only adds
> a build target/rule, but doesn't actually use it anywhere yet..

For your reference I started with this one [1].

When I bisected, I just answered with defaults on whatever `make` told me at
the configuration stage.

The actual `make` command I used:

	make O=/path/to/the/result W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64

But there is nothing that can affect the described issue.

[1]: https://p.defau.lt/?ZSOdGnNxF9v9AQtrfDo_KQ
Andy Shevchenko Nov. 13, 2022, 12:36 p.m. UTC | #11
On Sun, Nov 13, 2022 at 02:20:48PM +0200, Andy Shevchenko wrote:
> On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
> > On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> > > On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > > > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > > > > 
> > > > > Hello all,
> > > > > 
> > > > > This is a series based on my patch here[0]. As suggested by Rob
> > > > > I've resurrected Frank's patch and appended it to mine as a series.
> > > > > 
> > > > > First patch here is my original patch, 3rd is Frank's patch but with
> > > > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > > > moving the source building macro into scripts/Makefile.lib.
> > > > > 
> > > > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > > > overlays. Split out by platform so they could be taken by platform
> > > > > maintainers or if easier ACK'd here and taken all together.
> > > > > 
> > > > > This should cover all the DTB overlays so we can remove the old .dts
> > > > > rule for overlays and make .dtso the only supported way, let me know
> > > > > if we want that this cycle and I can post that too.
> > > > > 
> > > > > Thanks,
> > > > > Andrew
> > > > > 
> > > > > Changes from v1[1]:
> > > > >   - Added patch to rename pi433 overlay.
> > > > >   - Cleaned wording on patch 4-6.
> > > > >   - Collected some ACKs
> > > > > 
> > > > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > > > > 
> > > > > Andrew Davis (6):
> > > > >    kbuild: Allow DTB overlays to built from .dtso named source files
> > > > >    kbuild: Allow DTB overlays to built into .dtso.S files
> > > > >    arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > > > >      .dtso
> > > > >    arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > > > >      .dtso
> > > > >    arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > > > >    staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > > > > 
> > > > > Frank Rowand (1):
> > > > >    of: overlay: rename overlay source files from .dts to .dtso
> > > > 
> > > > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > > > platform maintainers after a few days in linux-next.
> > > 
> > > The patch
> > > 
> > > commit 941214a512d8c80d47e720c17ec17e8539175e93
> > > Author: Andrew Davis <afd@ti.com>
> > > Date:   Mon Oct 24 12:34:29 2022 -0500
> > > 
> > >      kbuild: Allow DTB overlays to built into .dtbo.S files
> > > 
> > > broke the build reproducibility / no-op builds.
> > > 
> > > Before:
> > >    2+ execution of `make` on non-changed tree did nothing
> > > 
> > > Now:
> > >    Each run of `make` (even without a single bit changed) restarts vmlinux
> > >    rebuild.
> > > 
> > > Please, revert or fix.
> > > 
> > 
> > I do not see this behavior. What config are you using?
> > 
> > Not sure how this patch could be the root cause, it only adds
> > a build target/rule, but doesn't actually use it anywhere yet..
> 
> For your reference I started with this one [1].
> 
> When I bisected, I just answered with defaults on whatever `make` told me at
> the configuration stage.
> 
> The actual `make` command I used:
> 
> 	make O=/path/to/the/result W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64
> 
> But there is nothing that can affect the described issue.

Actually, O= might affect which Makefile is used and how.
The C=, CF= are sparse flags, W= is just warning level.

> [1]: https://p.defau.lt/?ZSOdGnNxF9v9AQtrfDo_KQ
Andy Shevchenko Nov. 14, 2022, 2:39 p.m. UTC | #12
On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
> On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> > On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > > > 
> > > > Hello all,
> > > > 
> > > > This is a series based on my patch here[0]. As suggested by Rob
> > > > I've resurrected Frank's patch and appended it to mine as a series.
> > > > 
> > > > First patch here is my original patch, 3rd is Frank's patch but with
> > > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > > moving the source building macro into scripts/Makefile.lib.
> > > > 
> > > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > > overlays. Split out by platform so they could be taken by platform
> > > > maintainers or if easier ACK'd here and taken all together.
> > > > 
> > > > This should cover all the DTB overlays so we can remove the old .dts
> > > > rule for overlays and make .dtso the only supported way, let me know
> > > > if we want that this cycle and I can post that too.
> > > > 
> > > > Thanks,
> > > > Andrew
> > > > 
> > > > Changes from v1[1]:
> > > >   - Added patch to rename pi433 overlay.
> > > >   - Cleaned wording on patch 4-6.
> > > >   - Collected some ACKs
> > > > 
> > > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > > > 
> > > > Andrew Davis (6):
> > > >    kbuild: Allow DTB overlays to built from .dtso named source files
> > > >    kbuild: Allow DTB overlays to built into .dtso.S files
> > > >    arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > > >      .dtso
> > > >    arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > > >      .dtso
> > > >    arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > > >    staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > > > 
> > > > Frank Rowand (1):
> > > >    of: overlay: rename overlay source files from .dts to .dtso
> > > 
> > > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > > platform maintainers after a few days in linux-next.
> > 
> > The patch
> > 
> > commit 941214a512d8c80d47e720c17ec17e8539175e93
> > Author: Andrew Davis <afd@ti.com>
> > Date:   Mon Oct 24 12:34:29 2022 -0500
> > 
> >      kbuild: Allow DTB overlays to built into .dtbo.S files
> > 
> > broke the build reproducibility / no-op builds.
> > 
> > Before:
> >    2+ execution of `make` on non-changed tree did nothing
> > 
> > Now:
> >    Each run of `make` (even without a single bit changed) restarts vmlinux
> >    rebuild.
> > 
> > Please, revert or fix.
> > 
> 
> I do not see this behavior. What config are you using?
> 
> Not sure how this patch could be the root cause, it only adds
> a build target/rule, but doesn't actually use it anywhere yet..

Just to confirm, I reverted the patch and everything went fine again,
so simple revert helps!

(Tested on today's Linux Next)
Andy Shevchenko Nov. 14, 2022, 4:06 p.m. UTC | #13
On Sun, Nov 13, 2022 at 02:36:33PM +0200, Andy Shevchenko wrote:
> On Sun, Nov 13, 2022 at 02:20:48PM +0200, Andy Shevchenko wrote:
> > On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
> > > On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> > > > On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > > > > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > > > > > 
> > > > > > Hello all,
> > > > > > 
> > > > > > This is a series based on my patch here[0]. As suggested by Rob
> > > > > > I've resurrected Frank's patch and appended it to mine as a series.
> > > > > > 
> > > > > > First patch here is my original patch, 3rd is Frank's patch but with
> > > > > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > > > > moving the source building macro into scripts/Makefile.lib.
> > > > > > 
> > > > > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > > > > overlays. Split out by platform so they could be taken by platform
> > > > > > maintainers or if easier ACK'd here and taken all together.
> > > > > > 
> > > > > > This should cover all the DTB overlays so we can remove the old .dts
> > > > > > rule for overlays and make .dtso the only supported way, let me know
> > > > > > if we want that this cycle and I can post that too.
> > > > > > 
> > > > > > Thanks,
> > > > > > Andrew
> > > > > > 
> > > > > > Changes from v1[1]:
> > > > > >   - Added patch to rename pi433 overlay.
> > > > > >   - Cleaned wording on patch 4-6.
> > > > > >   - Collected some ACKs
> > > > > > 
> > > > > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > > > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > > > > > 
> > > > > > Andrew Davis (6):
> > > > > >    kbuild: Allow DTB overlays to built from .dtso named source files
> > > > > >    kbuild: Allow DTB overlays to built into .dtso.S files
> > > > > >    arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > > > > >      .dtso
> > > > > >    arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > > > > >      .dtso
> > > > > >    arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > > > > >    staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > > > > > 
> > > > > > Frank Rowand (1):
> > > > > >    of: overlay: rename overlay source files from .dts to .dtso
> > > > > 
> > > > > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > > > > platform maintainers after a few days in linux-next.
> > > > 
> > > > The patch
> > > > 
> > > > commit 941214a512d8c80d47e720c17ec17e8539175e93
> > > > Author: Andrew Davis <afd@ti.com>
> > > > Date:   Mon Oct 24 12:34:29 2022 -0500
> > > > 
> > > >      kbuild: Allow DTB overlays to built into .dtbo.S files
> > > > 
> > > > broke the build reproducibility / no-op builds.
> > > > 
> > > > Before:
> > > >    2+ execution of `make` on non-changed tree did nothing
> > > > 
> > > > Now:
> > > >    Each run of `make` (even without a single bit changed) restarts vmlinux
> > > >    rebuild.
> > > > 
> > > > Please, revert or fix.
> > > > 
> > > 
> > > I do not see this behavior. What config are you using?
> > > 
> > > Not sure how this patch could be the root cause, it only adds
> > > a build target/rule, but doesn't actually use it anywhere yet..
> > 
> > For your reference I started with this one [1].
> > 
> > When I bisected, I just answered with defaults on whatever `make` told me at
> > the configuration stage.
> > 
> > The actual `make` command I used:
> > 
> > 	make O=/path/to/the/result W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64
> > 
> > But there is nothing that can affect the described issue.
> 
> Actually, O= might affect which Makefile is used and how.
> The C=, CF= are sparse flags, W= is just warning level.

As far as I can tell right now it's the OF_UNITTEST on x86_64 that makes the
above mentioned patch to be a culprit. Not sure if on ARM / ARM64 you can
reproduce that. And it's really strange nobody reported this for a week+.

Whatever, I'm open for the suggestions and material to test.

> > [1]: https://p.defau.lt/?ZSOdGnNxF9v9AQtrfDo_KQ
Andrew Davis Nov. 14, 2022, 8:43 p.m. UTC | #14
On 11/14/22 10:06 AM, Andy Shevchenko wrote:
> On Sun, Nov 13, 2022 at 02:36:33PM +0200, Andy Shevchenko wrote:
>> On Sun, Nov 13, 2022 at 02:20:48PM +0200, Andy Shevchenko wrote:
>>> On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
>>>> On 11/11/22 1:39 PM, Andy Shevchenko wrote:
>>>>> On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
>>>>>> On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
>>>>>>>
>>>>>>> Hello all,
>>>>>>>
>>>>>>> This is a series based on my patch here[0]. As suggested by Rob
>>>>>>> I've resurrected Frank's patch and appended it to mine as a series.
>>>>>>>
>>>>>>> First patch here is my original patch, 3rd is Frank's patch but with
>>>>>>> the unittest changes pulled out into the 2nd patch. That was re-worked
>>>>>>> moving the source building macro into scripts/Makefile.lib.
>>>>>>>
>>>>>>> Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
>>>>>>> overlays. Split out by platform so they could be taken by platform
>>>>>>> maintainers or if easier ACK'd here and taken all together.
>>>>>>>
>>>>>>> This should cover all the DTB overlays so we can remove the old .dts
>>>>>>> rule for overlays and make .dtso the only supported way, let me know
>>>>>>> if we want that this cycle and I can post that too.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Andrew
>>>>>>>
>>>>>>> Changes from v1[1]:
>>>>>>>    - Added patch to rename pi433 overlay.
>>>>>>>    - Cleaned wording on patch 4-6.
>>>>>>>    - Collected some ACKs
>>>>>>>
>>>>>>> [0] https://www.spinics.net/lists/kernel/msg4548509.html
>>>>>>> [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
>>>>>>>
>>>>>>> Andrew Davis (6):
>>>>>>>     kbuild: Allow DTB overlays to built from .dtso named source files
>>>>>>>     kbuild: Allow DTB overlays to built into .dtso.S files
>>>>>>>     arm64: dts: freescale: Rename DTB overlay source files from .dts to
>>>>>>>       .dtso
>>>>>>>     arm64: dts: renesas: Rename DTB overlay source files from .dts to
>>>>>>>       .dtso
>>>>>>>     arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
>>>>>>>     staging: pi433: overlay: Rename overlay source file from .dts to .dtso
>>>>>>>
>>>>>>> Frank Rowand (1):
>>>>>>>     of: overlay: rename overlay source files from .dts to .dtso
>>>>>>
>>>>>> I've applied patches 1-3 and 7. I'll send a PR for the branch to the
>>>>>> platform maintainers after a few days in linux-next.
>>>>>
>>>>> The patch
>>>>>
>>>>> commit 941214a512d8c80d47e720c17ec17e8539175e93
>>>>> Author: Andrew Davis <afd@ti.com>
>>>>> Date:   Mon Oct 24 12:34:29 2022 -0500
>>>>>
>>>>>       kbuild: Allow DTB overlays to built into .dtbo.S files
>>>>>
>>>>> broke the build reproducibility / no-op builds.
>>>>>
>>>>> Before:
>>>>>     2+ execution of `make` on non-changed tree did nothing
>>>>>
>>>>> Now:
>>>>>     Each run of `make` (even without a single bit changed) restarts vmlinux
>>>>>     rebuild.
>>>>>
>>>>> Please, revert or fix.
>>>>>
>>>>
>>>> I do not see this behavior. What config are you using?
>>>>
>>>> Not sure how this patch could be the root cause, it only adds
>>>> a build target/rule, but doesn't actually use it anywhere yet..
>>>
>>> For your reference I started with this one [1].
>>>
>>> When I bisected, I just answered with defaults on whatever `make` told me at
>>> the configuration stage.
>>>
>>> The actual `make` command I used:
>>>
>>> 	make O=/path/to/the/result W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64
>>>
>>> But there is nothing that can affect the described issue.
>>
>> Actually, O= might affect which Makefile is used and how.
>> The C=, CF= are sparse flags, W= is just warning level.
> 
> As far as I can tell right now it's the OF_UNITTEST on x86_64 that makes the
> above mentioned patch to be a culprit. Not sure if on ARM / ARM64 you can
> reproduce that. And it's really strange nobody reported this for a week+.
> 
> Whatever, I'm open for the suggestions and material to test.
> 

I think I found the issue, we forgot to add the new dtbo.S/o files
to the list of preserved intermediate targets, so Make was
removing them after build.

Sending the fix now.

Thanks,
Andrew

>>> [1]: https://p.defau.lt/?ZSOdGnNxF9v9AQtrfDo_KQ
>
Andy Shevchenko Nov. 15, 2022, 11:29 a.m. UTC | #15
On Mon, Nov 14, 2022 at 02:43:51PM -0600, Andrew Davis wrote:
> On 11/14/22 10:06 AM, Andy Shevchenko wrote:
> > On Sun, Nov 13, 2022 at 02:36:33PM +0200, Andy Shevchenko wrote:
> > > On Sun, Nov 13, 2022 at 02:20:48PM +0200, Andy Shevchenko wrote:
> > > > On Fri, Nov 11, 2022 at 03:05:20PM -0600, Andrew Davis wrote:
> > > > > On 11/11/22 1:39 PM, Andy Shevchenko wrote:
> > > > > > On Wed, Oct 26, 2022 at 09:11:21AM -0500, Rob Herring wrote:
> > > > > > > On Mon, Oct 24, 2022 at 12:34 PM Andrew Davis <afd@ti.com> wrote:
> > > > > > > > 
> > > > > > > > Hello all,
> > > > > > > > 
> > > > > > > > This is a series based on my patch here[0]. As suggested by Rob
> > > > > > > > I've resurrected Frank's patch and appended it to mine as a series.
> > > > > > > > 
> > > > > > > > First patch here is my original patch, 3rd is Frank's patch but with
> > > > > > > > the unittest changes pulled out into the 2nd patch. That was re-worked
> > > > > > > > moving the source building macro into scripts/Makefile.lib.
> > > > > > > > 
> > > > > > > > Patches 4, 5, and 6 are an attempt at renaming all the existing DTB
> > > > > > > > overlays. Split out by platform so they could be taken by platform
> > > > > > > > maintainers or if easier ACK'd here and taken all together.
> > > > > > > > 
> > > > > > > > This should cover all the DTB overlays so we can remove the old .dts
> > > > > > > > rule for overlays and make .dtso the only supported way, let me know
> > > > > > > > if we want that this cycle and I can post that too.
> > > > > > > > 
> > > > > > > > Thanks,
> > > > > > > > Andrew
> > > > > > > > 
> > > > > > > > Changes from v1[1]:
> > > > > > > >    - Added patch to rename pi433 overlay.
> > > > > > > >    - Cleaned wording on patch 4-6.
> > > > > > > >    - Collected some ACKs
> > > > > > > > 
> > > > > > > > [0] https://www.spinics.net/lists/kernel/msg4548509.html
> > > > > > > > [1] https://www.spinics.net/lists/arm-kernel/msg1020165.html
> > > > > > > > 
> > > > > > > > Andrew Davis (6):
> > > > > > > >     kbuild: Allow DTB overlays to built from .dtso named source files
> > > > > > > >     kbuild: Allow DTB overlays to built into .dtso.S files
> > > > > > > >     arm64: dts: freescale: Rename DTB overlay source files from .dts to
> > > > > > > >       .dtso
> > > > > > > >     arm64: dts: renesas: Rename DTB overlay source files from .dts to
> > > > > > > >       .dtso
> > > > > > > >     arm64: dts: xilinx: Rename DTB overlay source files from .dts to .dtso
> > > > > > > >     staging: pi433: overlay: Rename overlay source file from .dts to .dtso
> > > > > > > > 
> > > > > > > > Frank Rowand (1):
> > > > > > > >     of: overlay: rename overlay source files from .dts to .dtso
> > > > > > > 
> > > > > > > I've applied patches 1-3 and 7. I'll send a PR for the branch to the
> > > > > > > platform maintainers after a few days in linux-next.
> > > > > > 
> > > > > > The patch
> > > > > > 
> > > > > > commit 941214a512d8c80d47e720c17ec17e8539175e93
> > > > > > Author: Andrew Davis <afd@ti.com>
> > > > > > Date:   Mon Oct 24 12:34:29 2022 -0500
> > > > > > 
> > > > > >       kbuild: Allow DTB overlays to built into .dtbo.S files
> > > > > > 
> > > > > > broke the build reproducibility / no-op builds.
> > > > > > 
> > > > > > Before:
> > > > > >     2+ execution of `make` on non-changed tree did nothing
> > > > > > 
> > > > > > Now:
> > > > > >     Each run of `make` (even without a single bit changed) restarts vmlinux
> > > > > >     rebuild.
> > > > > > 
> > > > > > Please, revert or fix.
> > > > > > 
> > > > > 
> > > > > I do not see this behavior. What config are you using?
> > > > > 
> > > > > Not sure how this patch could be the root cause, it only adds
> > > > > a build target/rule, but doesn't actually use it anywhere yet..
> > > > 
> > > > For your reference I started with this one [1].
> > > > 
> > > > When I bisected, I just answered with defaults on whatever `make` told me at
> > > > the configuration stage.
> > > > 
> > > > The actual `make` command I used:
> > > > 
> > > > 	make O=/path/to/the/result W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64
> > > > 
> > > > But there is nothing that can affect the described issue.
> > > 
> > > Actually, O= might affect which Makefile is used and how.
> > > The C=, CF= are sparse flags, W= is just warning level.
> > 
> > As far as I can tell right now it's the OF_UNITTEST on x86_64 that makes the
> > above mentioned patch to be a culprit. Not sure if on ARM / ARM64 you can
> > reproduce that. And it's really strange nobody reported this for a week+.
> > 
> > Whatever, I'm open for the suggestions and material to test.
> 
> I think I found the issue, we forgot to add the new dtbo.S/o files
> to the list of preserved intermediate targets, so Make was
> removing them after build.
> 
> Sending the fix now.

I'll test it ASAP and reply there.
Thank you.

> > > > [1]: https://p.defau.lt/?ZSOdGnNxF9v9AQtrfDo_KQ