mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konradybcio@kernel.org>
To: Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	 Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	 Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: [PATCH] kbuild: dtbinst: Create destination directories before installing
Date: Fri, 16 Oct 2026 16:40:01 +0200	[thread overview]
Message-ID: <20261016-topic-dtbs_install_fix-v1-1-8cf50b642cba@oss.qualcomm.com> (raw)

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

dtbs_install installs each DTB with 'install -D', which creates the
parent directory of the destination on demand. With a parallel build,
two DTBs that share a not yet existing directory are installed
concurrently and both try to create it. The loser fails, which aborts
the whole build:

  install: cannot create directory 'debian/linux-image-7.1.0/usr/lib/linux-image-7.1.0/arm'
  make[6]: *** [scripts/Makefile.dtbinst:23: .../arm/foundation-v8-gicv3.dtb] Error 1

The failure depends on job scheduling, so it shows up as a build that
fails for no apparent reason and passes when re-run.

Create all destination directories up front, the same way
scripts/Makefile.modinst does for modules, so the install rules no
longer race.

Fixes: aefd80307a05 ("kbuild: refactor Makefile.dtbinst more")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 scripts/Makefile.dtbinst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 9d920419a62c..a55f2a7acbc2 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -37,6 +37,10 @@ dtbs := $(notdir $(dtbs))
 
 endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
 
+# Create destination directories up front: with parallel make, concurrent
+# 'install -D' calls race on creating the same parent directory.
+$(foreach dir, $(sort $(dir $(addprefix $(dst)/, $(dtbs)))), $(shell mkdir -p $(dir)))
+
 __dtbs_install: $(addprefix $(dst)/, $(dtbs))
 	@:
 

---
base-commit: d419d682257d813f6cb7a28e42b35d0edf4ad038
change-id: 20261016-topic-dtbs_install_fix-7c0d9f206fdb

Best regards,
--  
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


             reply	other threads:[~2026-10-16 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 14:40 Konrad Dybcio [this message]
2026-11-05  4:42 ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261016-topic-dtbs_install_fix-v1-1-8cf50b642cba@oss.qualcomm.com \
    --to=konradybcio@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®