From: sashiko-bot@kernel.org
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/2] kbuild: Support directory targets for building DTBs
Date: Wed, 07 Oct 2026 19:03:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-163304@kernel.org> (raw)
In-Reply-To: <20261007-dtb-dirs-v3-v3-2-b3ab32b64fa6@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] kbuild: unconditional need-dtbslist=1 causes unnecessary dtb compilation and dtbs-list files during standard builds
--
commit 645916678e1f6dbf830062f35ddde56a42d6b0df
Author: Rob Herring (Arm) <robh@kernel.org>
kbuild: Support directory targets for building DTBs
This commit modifies the Kbuild system to allow directory targets for
building all device tree binaries (DTBs) within a directory. It updates
both dtbs and single-build targets to use directory rules.
> diff --git a/Makefile b/Makefile
> index c307ee9293bcd..75d290c2b7d88 100644
> --- a/Makefile
> +++ b/Makefile
[ ... ]
> @@ -2234,7 +2234,7 @@ prepare: outputmakefile
> # Error messages still appears in the original language
> PHONY += $(build-dir)
> $(build-dir): $(single-build-prep)
> - $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 $(single-goals)
> + $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 need-dtbslist=1 $(single-goals)
[Severity: High]
Does adding need-dtbslist=1 unconditionally to the $(build-dir) recipe
cause unnecessary dtb compilation and empty dtbs-list file generation
during standard builds?
Because standard KBUILD_VMLINUX_OBJS targets (like built-in.a) depend
on '.' (which evaluates to $(build-dir)), 'make vmlinux' evaluates this
rule to recurse into the source tree. This exports need-dtbslist=1 into
MAKEFLAGS, which is then inherited by all Kbuild sub-makes.
> diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs
> index c4e4663902844..c7ec2a2a308ef 100644
> --- a/scripts/Makefile.dtbs
> +++ b/scripts/Makefile.dtbs
> @@ -23,7 +23,9 @@ dtb-y := $(addprefix $(obj)/, $(dtb-y))
> multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y))
> real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y))
>
> +ifdef need-dtbslist
> always-y += $(dtb-y)
> +endif
> targets += $(real-dtb-y)
Because need-dtbslist=1 is globally inherited, it now unconditionally
appends all device trees to always-y in every visited directory.
Additionally, it triggers the generation of dtbs-list files across the
tree via existing code further down in scripts/Makefile.dtbs:
scripts/Makefile.dtbs:
ifdef need-dtbslist
subdir-dtbslist := $(addsuffix /dtbs-list, $(subdir-ym))
dtb-y += $(subdir-dtbslist)
always-y += $(obj)/dtbs-list
endif
Could this unconditionally traverse arch/$(SRCARCH)/boot/dts/ and
compile all device trees, regressing build times, while cluttering
unrelated directories (like fs/ or mm/) with empty dtbs-list files?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261007-dtb-dirs-v3-v3-0-b3ab32b64fa6@kernel.org?part=2
next prev parent reply other threads:[~2026-10-07 19:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 18:39 [PATCH v3 0/2] kbuild: Support directory targets for DTBs Rob Herring (Arm)
2026-10-07 18:39 ` [PATCH v3 1/2] kbuild: Convert %.dtb(o) targets to single target rules Rob Herring (Arm)
2026-10-07 18:39 ` [PATCH v3 2/2] kbuild: Support directory targets for building DTBs Rob Herring (Arm)
2026-10-07 19:03 ` sashiko-bot [this message]
2026-10-08 15:38 ` Rob Herring
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=sashiko-outbox-163304@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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