Received: by 10.192.165.156 with SMTP id m28csp733332imm; Mon, 16 Apr 2018 07:54:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/0U+Xsd1ixwYp87Sg28Cet6/M/inJsV3+dflHxZ5W54M7OpM725Qx/xxmKya0qRQofS+Y X-Received: by 10.98.159.200 with SMTP id v69mr21958065pfk.230.1523890476010; Mon, 16 Apr 2018 07:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523890475; cv=none; d=google.com; s=arc-20160816; b=wlnzir2ZnIb/iONJNP2SW0RmgtFwWj6pWFAHQuC3PfKSzFB9Ni64WcrwLLFvAqXhDl SF8R9Zd9FudJRluFerPxy1GsYvmI2gi9fa0gc+jJot+WHh2QCor+SfOCmSGL14FZmKFY mq8A3L7vvI8lbKXgYfGO48KWwynJTdY8xJCRBGm/wO9Q//8uzpTpx8NHx6ZVRPrOr8NO 4PKD+p8y63r6tTeAhidfrsAaTYXz7AA8DF8cYefqdbuA/nnof88mtmjhvRf0ZenofKDB a2ZaBCCxt6l50z9Cwvc6zJ8yju5iRgzQxBCF1aUvhFDduwf/ZI6u74rVYfpbHYmSGgoZ eXDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=CYPFusBhS8V9N+DmVeG5V++6ZLl4j07EeJcsetbKx8Q=; b=Dgw058T5/RmfOOVcCP32NI+YIsk4/C1x9Du3yA3cEZcVDaYMVRJ2dDNYcVRP+AFXdp xJxPn5TY8IzLM+k/w82gjqvR5bvIuJsrx83HbobK6CynaqSdcGW49mZSD936jM1oIRCw PGt6wE8SH/FXvLz8u+MZMuzsXXi5AuGCxpluMSucaS2M8BL1tJdfq2SZ7oAQ0pLqWNMB t6YCsLy0nrNMsdqjrAUwtLC9fMmV2+Z8m9Hrdz2RgryVnVSpfVKdXOltGs1ZI7vdfZbM GOlSqENLki3ql4alX2YUce6RcEVMoP/93riJ3r20qk+F7ak8p+9A3eBB2AtMqans5xMG Kzrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lWKM97y9; 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 e15si9928939pgu.656.2018.04.16.07.54.22; Mon, 16 Apr 2018 07:54:35 -0700 (PDT) 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=lWKM97y9; 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 S1751908AbeDPOs7 (ORCPT + 99 others); Mon, 16 Apr 2018 10:48:59 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62201 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbeDPOs5 (ORCPT ); Mon, 16 Apr 2018 10:48:57 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w3GElqtv017749; Mon, 16 Apr 2018 23:47:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w3GElqtv017749 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523890080; bh=CYPFusBhS8V9N+DmVeG5V++6ZLl4j07EeJcsetbKx8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWKM97y9xEuDDb1MqFSJF3B7dcmRaP0rmx2WKjAWIJb3aRiX+qz6H5TPwbXXICQF8 njpMNCAa6i3VyEbPqbkhfGcQ/TAWz+78i3sJ9RhnhBtdOC7YmUfhF1G+tTsfRFvY6q zocHwbACaVSbuiQMnsvH2L0kfQcAuvc9bXn2v3ozYY+AArdHt4EZLmMxGOloWV9jty 2c5cFOF5TMqNSjbGWgTYDqzSIoNaxrw+EMW4NvDOOD1ecHu073r3X8tLN2ksjRh2Ph 6NmTNX121chIYyFBnLwmwl7fxMulkuyfr/8wGTQsB9nFmzdq4ytZNyDAlkY5X4GzCv Ir6wr2FdpAxnQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: Ralf Baechle , James Hogan , linux-mips@linux-mips.org Cc: Paul Burton , Masahiro Yamada , Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] MIPS: boot: rebuild ITB when contained DTB is updated Date: Mon, 16 Apr 2018 23:47:47 +0900 Message-Id: <1523890067-13641-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523890067-13641-1-git-send-email-yamada.masahiro@socionext.com> References: <1523890067-13641-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since now, the unnecessary rebuild of ITB has been fixed. Another problem to be taken care of is, missed rebuild of ITB. For example, board-boston.its.S includes boston.dtb by the /incbin/ directive. If boston.dtb is updated, vmlinux.*.dtb must be rebuilt. Currently, the dependency between ITB and contained DTB files is not described anywhere. Previously, this problem was hidden since vmlinux.*.itb was always rebuilt even if nothing is updated. By fixing the spurious rebuild, this is a real problem now. Use the same strategy for automatic generation of the header file dependency. DTC works as a backend of mkimage, and DTC supports -d option. It outputs the dependencies, including binary files pulled by the /incbin/ directive. The implementation is simpler than cmd_dtc in scripts/Makefile.lib since we do not need CPP here. Just pass -d $(depfile) to DTC, and let the resulted $(depfile) processed by fixdep. It might be unclear why "$(obj)/dts/%.dtb: ;" is needed. With this commit, *.cmd files will contain dependency on DTB files. In the next invocation of build, the *.cmd files will be included, then Make will try to find a rule to update *.dtb files. Unfortunately, it is found in scripts/Makefile.lib. The build rule of $(obj)/%.dtb is invoked by if_changed_dep, so it needs to include *.cmd files of DTB, but they are not included because we are in arch/mips/boot, but those *.cmd files reside in arch/mips/boot/dts/*/. Cancel the pattern rule in scripts/Makefile.lib to suppress unneeded rebuilding of DTB. Signed-off-by: Masahiro Yamada --- arch/mips/boot/Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile index d102d53..f8dce5b 100644 --- a/arch/mips/boot/Makefile +++ b/arch/mips/boot/Makefile @@ -163,11 +163,18 @@ quiet_cmd_itb-image = ITB $@ $(CONFIG_SHELL) $(MKIMAGE) \ -D "-I dts -O dtb -p 500 \ --include $(objtree)/arch/mips \ - --warning no-unit_address_vs_reg" \ + --warning no-unit_address_vs_reg \ + -d $(depfile)" \ -f $(2) $@ $(obj)/vmlinux.itb: $(obj)/vmlinux.its $(obj)/vmlinux.bin FORCE - $(call if_changed,itb-image,$<) + $(call if_changed_dep,itb-image,$<) $(obj)/vmlinux.%.itb: $(obj)/vmlinux.%.its $(obj)/vmlinux.bin.% FORCE - $(call if_changed,itb-image,$<) + $(call if_changed_dep,itb-image,$<) + +# The -d option of DTC outputs dependencies of binaries included by the +# /incbin/ directive. When .*.cmd files are included, Kbuild tries to +# update *.dtb because it sees a pattern rule defined in scripts/Makefile.lib. +# The rule must be cancelled by a more specific rule. +$(obj)/dts/%.dtb: ; -- 2.7.4