linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	Frank.Rowand@sony.com, "Arnd Bergmann" <arnd@arndb.de>,
	"David Airlie" <airlied@linux.ie>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"DRI Development" <dri-devel@lists.freedesktop.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Frank Rowand" <frowand.list@gmail.com>
Subject: Re: [PATCH] [RFC] drm: rcar-du: keep temporary dtb files around during build
Date: Fri, 23 Mar 2018 22:27:15 +0900	[thread overview]
Message-ID: <CAK7LNAQB4q-azLkig1eJKvYvAPHeRgM7sYES0LQT-1AP5McQtw@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUdsH3r7AZMB6NfNyrDdJecXx1JhGZFA=32VYZBtmGP5w@mail.gmail.com>

2018-03-23 0:13 GMT+09:00 Geert Uytterhoeven <geert@linux-m68k.org>:
> Hi Laurent,
>
> CC Yamada-san
>
> On Thu, Mar 22, 2018 at 3:50 PM, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
>> On Thursday, 22 March 2018 16:26:22 EET Geert Uytterhoeven wrote:
>>> On Fri, Mar 16, 2018 at 2:39 AM,  <Frank.Rowand@sony.com> wrote:
>>> > On Thursday, March 15, 2018 8:37 AM, Arnd Bergmann wrote:
>>> >> The *.dtb and *.dtb.S files get removed by 'make' during the build
>>> >> process, and later seem to be missed during the 'modpost' stage:
>>> >>
>>> >> rm drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dtb
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dtb
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dtb.S
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dtb.S
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb.S
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dtb
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dtb
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dtb.S
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dtb.S
>>> >> WARNING: could not open
>>> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb.S: No such file or
>>> >> directory
>>> >>
>>> >> As a workaround, this adds all those files to the 'extra-y' target list,
>>> >> but that's really ugly. Any ideas for a better fix?
>>> >
>>> > Does this work for you (untested, but the way it is done in
>>> > drivers/of/unittest-data/Makefile):
>>> >
>>> > .PRECIOUS: \
>>> >
>>> >         $(obj)/%.dtb.S \
>>> >         $(obj)/%.dtb
>>>
>>> Shouldn't that just be moved to scripts/Makefile.lib, just above the rule
>>> to make dtb.S, like is done for other precious objects?
>>
>> Without any implied acknowledgment that keeping those intermediate files is
>> the right solution (I don't claim to master the kernel build system), I think
>
> Me neither, but I think it is.
>
> Cfr. .y => .tab.c => .tab.o with .tab.c marked PRECIOUS.
>
>> such a rule would indeed be better in a core Makefile, as the rules to build
>> the .dtb.o file comes from the core too. Could another option be to create a
>> rule to compile a .dtb.o from the .dts file directly without going through
>> intermediate files that will be removed automatically ?
>
> Such a rules needs to execute two commands, which is more tricky, considering
> error handling.
> It's easier (to get right) to have two separate rules, and let make chain them
> automatically.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>


I submit the patches.
I'd like to queue them up for the next merge window,
so your problems will be fixed if Kbuild pull requests are pulled.

The driver Makefile has two problems.

[1] Objects are always rebuilt due to missing 'targets'
[2] Intermediate files are removed due to missing .SECONDARY (or .PRECIOUS)

If you want to fix them by yourself, you can.

But, those issues will be taken care of by the core Makefile.

Specifically, [1] will be fixed by
https://patchwork.kernel.org/patch/10304671/

and [2] by
https://patchwork.kernel.org/patch/10304651/




-- 
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2018-03-23 13:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 15:37 [PATCH] [RFC] drm: rcar-du: keep temporary dtb files around during build Arnd Bergmann
2018-03-16  1:39 ` Frank.Rowand
2018-03-16  8:25   ` Arnd Bergmann
2018-03-20 13:15     ` Laurent Pinchart
2018-03-21  7:38       ` Arnd Bergmann
2018-03-21  9:58         ` Laurent Pinchart
2018-03-22 14:26   ` Geert Uytterhoeven
2018-03-22 14:50     ` Laurent Pinchart
2018-03-22 15:13       ` Geert Uytterhoeven
2018-03-22 17:47         ` Masahiro Yamada
2018-03-23 13:27         ` Masahiro Yamada [this message]
2018-03-24  1:31     ` Frank Rowand

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=CAK7LNAQB4q-azLkig1eJKvYvAPHeRgM7sYES0LQT-1AP5McQtw@mail.gmail.com \
    --to=yamada.masahiro@socionext.com \
    --cc=Frank.Rowand@sony.com \
    --cc=airlied@linux.ie \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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;
as well as URLs for NNTP newsgroup(s).