Re: [U-Boot] [PATCH] imx: Create distinct pre-processed mkimage config files

2018-04-15 Thread Stefano Babic


On 07/04/2018 02:11, Trent Piepho wrote:
> Each imx image is created by a separate sub-make and during this process
> the mkimage config file is run though cpp.
> 
> The cpp output is to the same file no matter what imx image is being
> created.
> 
> This means if two imx images are generated in parallel they will attempt
> to independently produce the same pre-processed mkimage config file at
> the same time.
> 
> Avoid the problem by making the pre-processed config file name unique
> based on the imx image it will be used in.  This way each image will
> create a unique config file and they won't clobber each other when run
> in parallel.
> 
> This should fixed the build bug referenced in b5b0e4e3 ("imximage:
> Remove failure when no IVT offset is found").
> 
> Cc: Breno Lima 
> Cc: Thomas Petazzoni 
> Cc: Fabio Estevam 
> Signed-off-by: Trent Piepho 
> ---
>  arch/arm/mach-imx/Makefile | 15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 95a542fa01..306f779392 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -78,9 +78,11 @@ endif
>  quiet_cmd_cpp_cfg = CFGS$@
>cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
>  
> -IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
> +# mkimage source config file
> +IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
>  
> -$(IMX_CONFIG): %.cfgtmp: % FORCE
> +# How to create a cpp processed config file, they all use the same source
> +%.cfgout: $(IMX_CONFIG) FORCE
>   $(Q)mkdir -p $(dir $@)
>   $(call if_changed_dep,cpp_cfg)
>  
> @@ -88,7 +90,7 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< 
> $(PHONY),$^) -T imxim
>   -e $(CONFIG_SYS_TEXT_BASE)
>  u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
>  
> -u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
> +u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
>   $(call if_changed,mkimage)
>  
>  ifeq ($(CONFIG_OF_SEPARATE),y)
> @@ -96,16 +98,15 @@ MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out 
> $(PLUGIN).bin $< $(PHONY),$^) -T i
>   -e $(CONFIG_SYS_TEXT_BASE)
>  u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
>  
> -u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
> +u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
>   $(call if_changed,mkimage)
>  endif
>  
>  MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage 
> \
>   -e $(CONFIG_SPL_TEXT_BASE)
> -
>  SPL: MKIMAGEOUTPUT = SPL.log
>  
> -SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
> +SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
>   $(call if_changed,mkimage)
>  
>  MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
> @@ -133,7 +134,7 @@ cmd_u-boot-nand-spl_imx = (printf 
> '\000\000\000\000\106\103\102\040\001' && \
>  spl/u-boot-nand-spl.imx: SPL FORCE
>   $(call if_changed,u-boot-nand-spl_imx)
>  
> -targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim 
> spl/u-boot-nand-spl.imx)
> +targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout 
> u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
>  
>  obj-$(CONFIG_ARM64) += sip.o
>  
> 


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] imx: Create distinct pre-processed mkimage config files

2018-04-06 Thread Fabio Estevam
Hi Trent,

On Fri, Apr 6, 2018 at 9:11 PM, Trent Piepho  wrote:
> Each imx image is created by a separate sub-make and during this process
> the mkimage config file is run though cpp.
>
> The cpp output is to the same file no matter what imx image is being
> created.
>
> This means if two imx images are generated in parallel they will attempt
> to independently produce the same pre-processed mkimage config file at
> the same time.
>
> Avoid the problem by making the pre-processed config file name unique
> based on the imx image it will be used in.  This way each image will
> create a unique config file and they won't clobber each other when run
> in parallel.
>
> This should fixed the build bug referenced in b5b0e4e3 ("imximage:
> Remove failure when no IVT offset is found").
>
> Cc: Breno Lima 
> Cc: Thomas Petazzoni 
> Cc: Fabio Estevam 
> Signed-off-by: Trent Piepho 

I reverted b5b0e4e3, applied your patch and don't see the original
failure anymore.

Thanks for providing a proper fix!

Tested-by: Fabio Estevam 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] imx: Create distinct pre-processed mkimage config files

2018-04-06 Thread Trent Piepho
Each imx image is created by a separate sub-make and during this process
the mkimage config file is run though cpp.

The cpp output is to the same file no matter what imx image is being
created.

This means if two imx images are generated in parallel they will attempt
to independently produce the same pre-processed mkimage config file at
the same time.

Avoid the problem by making the pre-processed config file name unique
based on the imx image it will be used in.  This way each image will
create a unique config file and they won't clobber each other when run
in parallel.

This should fixed the build bug referenced in b5b0e4e3 ("imximage:
Remove failure when no IVT offset is found").

Cc: Breno Lima 
Cc: Thomas Petazzoni 
Cc: Fabio Estevam 
Signed-off-by: Trent Piepho 
---
 arch/arm/mach-imx/Makefile | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 95a542fa01..306f779392 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -78,9 +78,11 @@ endif
 quiet_cmd_cpp_cfg = CFGS$@
   cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
 
-IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
+# mkimage source config file
+IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
 
-$(IMX_CONFIG): %.cfgtmp: % FORCE
+# How to create a cpp processed config file, they all use the same source
+%.cfgout: $(IMX_CONFIG) FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cpp_cfg)
 
@@ -88,7 +90,7 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< 
$(PHONY),$^) -T imxim
-e $(CONFIG_SYS_TEXT_BASE)
 u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
 
-u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
+u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
@@ -96,16 +98,15 @@ MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin 
$< $(PHONY),$^) -T i
-e $(CONFIG_SYS_TEXT_BASE)
 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
 
-u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
+u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 endif
 
 MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
-e $(CONFIG_SPL_TEXT_BASE)
-
 SPL: MKIMAGEOUTPUT = SPL.log
 
-SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
+SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
@@ -133,7 +134,7 @@ cmd_u-boot-nand-spl_imx = (printf 
'\000\000\000\000\106\103\102\040\001' && \
 spl/u-boot-nand-spl.imx: SPL FORCE
$(call if_changed,u-boot-nand-spl_imx)
 
-targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim 
spl/u-boot-nand-spl.imx)
+targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout 
u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
 
 obj-$(CONFIG_ARM64) += sip.o
 
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot