Thread (12 messages) 12 messages, 2 authors, 2018-06-20

Re: [PATCH 7/7] MIPS: boot: rebuild ITB when contained DTB is updated

From: Paul Burton <hidden>
Date: 2018-06-20 00:27:09
Also in: lkml

Hi Masahiro,

On Mon, Apr 16, 2018 at 07:47:47AM -0700, Masahiro Yamada wrote:
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 <redacted>
---

 arch/mips/boot/Makefile | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Thanks - this looks good to me except that it starts outputting a "Don't
know how to preprocess itb-image" message after building the .itb.

I presume we just need an extra case adding to ksym_dep_filter. Do you
want to add that in & resubmit this one?

Thanks,
    Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help