Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1427398imu; Fri, 7 Dec 2018 22:55:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4+yJE1EbQJ9NO8igN+mx8ti16Gjj6Xv/CmHDjKRdE13LNFKqBWuvrfwfaRbIq8A3jgtuW X-Received: by 2002:a62:2606:: with SMTP id m6mr4880006pfm.133.1544252147002; Fri, 07 Dec 2018 22:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544252146; cv=none; d=google.com; s=arc-20160816; b=PtWRIIJI5cfpu0M2iiakk0oCRh6aQguA15Vh47KtOEp1b+8I6r/RM5eKRb8JrMyEUZ 93bTW9adyjnFT44H3IzL3YrNCbBSlqvJjaB1uzHwVsMtT7/WA49R8OyLkFbI0emt4wlY l8nlq7h4UYlpoxRJufCEt7wgNPNs8N6dI4eJGjYOAzwEir5nzDz7Jjfjz/2xzXjxcBbf NbO61IoI1TnHEaMLzZ1+Zznbq62JAIV0hpj2Xr3fBfOALro032bZJ2/pZ/mUF1Z+9HPB pnEI1gezhGS1nlUlh7aV0tSjWxYMFfQy51Zyk9wOsxjzOsuw4IM8G3HVmw7iLiNmNHDJ X/9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=K0V/brdv1afN59ArpYbZlRexSGKTC+L144URixQKO5Q=; b=VQXBJYnWgVQSDNzELt6ONmf84JGCAOw35SnGJcmkq+NMuWrByHGajAZKLHhuKZcmCm 0RzIWR8sIJqAWD+TVHpnl0R9BA+Xb4fwW85LASHZxndRhN4SEXs9Az/p8SQi2c6vfdwn m7NWit28aRQc6SQaR3T5RN81nkRGgpHpBSeUvbM39bhw/btvyCsH19vIq7ETARJHTtqs tihtu8HSfvwpVOBDFOv4vhguLMO8n/1qZgg41nY1BdcNmB4LjFYISO0G+KFRJji5a6+I RcIhqhkl1BzOWAXaLSmT3paLVcCl3AFX1TTGt2kEYxjTQ9kO/ryDc7ZRywvnuHg9WsYx D4QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DbzflONf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si4095752pgy.408.2018.12.07.22.55.19; Fri, 07 Dec 2018 22:55:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DbzflONf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726226AbeLHGwU (ORCPT + 99 others); Sat, 8 Dec 2018 01:52:20 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:41949 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726186AbeLHGwU (ORCPT ); Sat, 8 Dec 2018 01:52:20 -0500 Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (authenticated) by conssluserg-03.nifty.com with ESMTP id wB86qGKb000626; Sat, 8 Dec 2018 15:52:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com wB86qGKb000626 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544251937; bh=K0V/brdv1afN59ArpYbZlRexSGKTC+L144URixQKO5Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DbzflONfaZdT7jVYMezKpa2p/tyZhlTH/bg+XB1Sdk8kbskUon2Z0njHwdXMi3zyq vIfYleIhYQ54FFcDPL9wNCcv7jGj3MfpXS6mi+RWqm/glETWlxwms1hvK5irJDmv8p eQRc7rBOPLFraOyaA5kDQ0BYt4Nr6PkVFuZiGZq4DJE57buKTpjlfGskGo4vs9revQ K9Y5VHE76lQbLPRzp7uHiMdWhRPICLrvoYEANaNj0RdTKEJt1mijq2A6s9SOmaDfXE iqxN6oNPoJg4eDrWqGouZC7YmdU17PD0rpmjP3hKv0LYoxloTSz+ERA8yYaMFjICyK xniJEXNqe22/w== X-Nifty-SrcIP: [209.85.217.52] Received: by mail-vs1-f52.google.com with SMTP id e7so3811277vsc.2; Fri, 07 Dec 2018 22:52:17 -0800 (PST) X-Gm-Message-State: AA+aEWZ97tbVNb78ZAXS4cWGU2a67OeTidixYPxYnTu+lpsuV4HH6xZx 9kMnr+fgD9XWWuJB93mYFUJU6U5M/dJRSG2b1XQ= X-Received: by 2002:a67:a858:: with SMTP id r85mr2111685vse.215.1544251935736; Fri, 07 Dec 2018 22:52:15 -0800 (PST) MIME-Version: 1.0 References: <1543823457-32478-1-git-send-email-yamada.masahiro@socionext.com> <1543823457-32478-7-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: From: Masahiro Yamada Date: Sat, 8 Dec 2018 15:51:39 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/7] microblaze: fix race condition in building boot images To: Michal Simek Cc: Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 6, 2018 at 1:32 AM Michal Simek wrote: > > On 03. 12. 18 8:50, Masahiro Yamada wrote: > > I fixed a race condition in the parallel building of ARM in commit > > 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not > > generate invalid images"). > > > > I see the same problem for MicroBlaze too. > > > > "make -j ARCH=microblaze all linux.bin.ub" results in a broken build > > since two threads descend into arch/microblaze/boot simultaneously. > > I see also different problem that when I run that make above > linux.bin.ub is not generated at all. That's why I am fixing the problem. Before the fix, the parallel build fails. /usr/bin/mkimage: Can't read arch/microblaze/boot/linux.bin: Invalid argument arch/microblaze/boot/Makefile:14: recipe for target 'arch/microblaze/boot/linux.bin.ub' failed make[1]: *** [arch/microblaze/boot/linux.bin.ub] Error 1 make[1]: *** Deleting file 'arch/microblaze/boot/linux.bin.ub' arch/microblaze/Makefile:87: recipe for target 'linux.bin.ub' failed make: *** [linux.bin.ub] Error 2 make: *** Waiting for unfinished jobs.... MODPOST 6 modules Kernel: arch/microblaze/boot/linux.bin is ready (#2) > > > > > Add proper dependencies to avoid it. > > > > Signed-off-by: Masahiro Yamada > > --- > > > > arch/microblaze/Makefile | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile > > index 7a5df02..544796d 100644 > > --- a/arch/microblaze/Makefile > > +++ b/arch/microblaze/Makefile > > @@ -79,13 +79,15 @@ all: linux.bin > > archclean: > > $(Q)$(MAKE) $(clean)=$(boot) > > > > +linux.bin.ub linux.bin.gz: linux.bin > > + > > PHONY += linux.bin linux.bin.gz linux.bin.ub > > linux.bin linux.bin.gz linux.bin.ub: vmlinux > > $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ > > @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' > > > > PHONY += simpleImage.$(DTB) > > -simpleImage.$(DTB): vmlinux > > +simpleImage.$(DTB): linux.bin.ub > > It looks weird that simpleImage requires linux.bin.ub. > Is it really linux.bin.ub here or just linux.bin? This is intentional to avoid a race in "make simpleImage.
linux.bin.ub" But, I chose to make simpleImage* independent of linux.bin* in v2. I hope you will like it. > > $(Q)$(MAKE) $(build)=$(boot) simple_images > > @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' > > > > > > > Thanks, > Michal > > -- > Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 > w: www.monstr.eu p: +42-0-721842854 > Maintainer of Linux kernel - Xilinx Microblaze > Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs > U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs > > -- Best Regards Masahiro Yamada