From patchwork Sun Nov 2 20:52:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Cooper X-Patchwork-Id: 5213111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0FFB5C11AC for ; Sun, 2 Nov 2014 20:55:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 287CB20254 for ; Sun, 2 Nov 2014 20:55:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E41E20253 for ; Sun, 2 Nov 2014 20:55:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xl29R-0001mp-W5; Sun, 02 Nov 2014 20:53:30 +0000 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xl29P-0001kX-Rm for linux-arm-kernel@lists.infradead.org; Sun, 02 Nov 2014 20:53:28 +0000 Received: from pool-96-249-243-124.nrflva.fios.verizon.net ([96.249.243.124] helo=titan) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xl291-0000E2-VP; Sun, 02 Nov 2014 20:53:04 +0000 Received: from triton.lakedaemon.net (triton.lakedaemon.net [10.16.5.177]) by titan (Postfix) with ESMTP id 3D28B60FD09; Sun, 2 Nov 2014 15:53:01 -0500 (EST) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 96.249.243.124 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/8+gPUhyQpMfBnFrqYqszPXkIWaTTDJcs= X-DKIM: OpenDKIM Filter v2.0.1 titan 3D28B60FD09 From: Jason Cooper To: Russell King , Linus Walleij , Grant Likely , Rob Herring Subject: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs' Date: Sun, 2 Nov 2014 20:52:29 +0000 Message-Id: <1414961549-31666-1-git-send-email-jason@lakedaemon.net> X-Mailer: git-send-email 2.1.3 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141102_125327_984093_97643EFF X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, Jason Cooper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After this patch: f4d4ffc03efc kbuild: dtbs_install: new make target was added the kernel tree, Linus Walleij noticed that 'make dtbs' forced a following 'make zImage' to rebuild the entire tree, even though nothing had changed. His report: After this patch a while back I have observed the following behaviour of the kernel build: make zImage make zImage -> incremental build, just relink make zImage make dtbs make zImage -> The whole kernel gets rebuilt So now if I happen to recompile my device trees, I suddenly want the entire zImage to be rebuilt to? It's by definition not changes that affect the kernel build :-( I noticed this because my build scripts calls make dtbs && make zImage, and started to rebuild absolutely everything all the time. To fix this, we make only the dtbs_install target depend on the prepare target. It's needed to make sure KERNELVERSION is calculated prior to installing. Fixes: f4d4ffc03efc: ("kbuild: dtbs_install: new make target") Reported-by: Linus Walleij Tested-by: Linus Walleij Signed-off-by: Jason Cooper --- Note: I've no idea if this is a 100% correct solution or not. I know it's definitely better than what we have currently. If there is another way to guarantee KERNELVERSION is set other than depending on 'prepare', I'd love to hear it. thx, Jason. arch/arm/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 034a94904d69..ae1c278128f8 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -312,7 +312,9 @@ $(INSTALL_TARGETS): $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ PHONY += dtbs dtbs_install -dtbs dtbs_install: prepare scripts +dtbs: scripts + $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ +dtbs_install: prepare scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ # We use MRPROPER_FILES and CLEAN_FILES now