2014-04-01 10:15:39

by Grant Likely

[permalink] [raw]
Subject: [git pull] Devicetree changes for v3.15

Hi Linus,

Here are the dt changes I've got queued up for v3.15. The full
description is below in the tag. Please pull.

Thanks,
g.

The following changes since commit fa389e220254c69ffae0d403eac4146171062d08:

Linux 3.14-rc6 (2014-03-09 19:41:57 -0700)

are available in the git repository at:

git://git.secretlab.ca/git/linux tags/dt-for-linus

for you to fetch changes up to d88cf7d7b4240b8df170ba105e414e476fb51cce:

Merge remote-tracking branch 'robh/for-next' into devicetree/next
(2014-03-31 08:10:55 +0100)

----------------------------------------------------------------

Devicetree changes for v3.15

Updates to devicetree core code. This branch contains the following
notable changes:
* Add reserved memory binding
* Make struct device_node a kobject and remove legacy /proc/device-tree
* ePAPR conformance fixes
* Update in-kernel DTC copy to version v1.4.0
* Preparation changes for dynamic device tree overlays
* minor bug fixes and documentation changes

The most significant change in this branch is the conversion of struct
device_node to be a kobject that is exposed via sysfs and removal of the
old /proc/device-tree code. This simplifies the device tree handling
code and tightens up the lifecycle on device tree nodes.

----------------------------------------------------------------
Andreas Herrmann (1):
of: Increase MAX_PHANDLE_ARGS

Florian Fainelli (1):
of: make of_get_phy_mode parse 'phy-connection-type'

Florian Vaussard (2):
of: add vendor prefix for SMSC
of: add missing major vendors

Grant Likely (13):
scripts/dtc: Update shipped files to build with bison 2.7.12
scripts/dtc: Update to upstream version v1.4.0
scripts/dtc: Add a script to update to mainline dtc source
Merge branch 'devicetree/dtc' into devicetree/next
Revert "of: fix of_update_property()"
Merge tag 'v3.14-rc5' into HEAD
of: document bindings for reserved-memory nodes
of: Make device nodes kobjects so they show up in sysfs
of/selftest: Add self tests for manipulation of properties
of: remove /proc/device-tree
Merge branch 'devicetree/next-reserved-mem' into devicetree/next
of: Add support for ePAPR "stdout-path" property
Merge remote-tracking branch 'robh/for-next' into devicetree/next

Gregory CLEMENT (2):
of: Allows to use the PCI translator without the PCI core
ARM: mvebu: Allows to get the SoC ID even without PCI enabled

Jason Cooper (1):
kbuild: dtbs_install: new make target

Josh Cartwright (1):
of: only scan for reserved mem when fdt present

Marek Szyprowski (6):
drivers: of: add initialization code for static reserved memory
drivers: of: add initialization code for dynamic reserved memory
drivers: of: add support for custom reserved memory drivers
arm: add support for reserved memory defined by device tree
arm64: add support for reserved memory defined by device tree
powerpc: add support for reserved memory defined by device tree

Pantelis Antoniou (3):
of: Introduce device tree node flag helpers.
of: Clear detach flag on attach
of: device_node kobject lifecycle fixes

Xiubo Li (2):
of: add __of_add_property() without lock operations
of: fix of_update_property()

Documentation/ABI/testing/sysfs-firmware-ofw | 28 ++
.../bindings/reserved-memory/reserved-memory.txt | 133 ++++++
.../devicetree/bindings/vendor-prefixes.txt | 17 +
Makefile | 7 +
arch/arm/Kconfig | 1 +
arch/arm/Makefile | 7 +-
arch/arm/boot/dts/Makefile | 4 +-
arch/arm/mach-mvebu/Kconfig | 1 +
arch/arm/mm/init.c | 2 +
arch/arm64/Kconfig | 1 +
arch/arm64/mm/init.c | 1 +
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/prom.c | 3 +
arch/powerpc/platforms/pseries/dlpar.c | 2 -
arch/powerpc/platforms/pseries/reconfig.c | 2 -
arch/powerpc/sysdev/msi_bitmap.c | 2 +-
drivers/of/Kconfig | 18 +-
drivers/of/Makefile | 1 +
drivers/of/address.c | 8 +-
drivers/of/base.c | 274 +++++++++---
drivers/of/fdt.c | 145 ++++++-
drivers/of/of_net.c | 11 +-
drivers/of/of_reserved_mem.c | 217 ++++++++++
drivers/of/pdt.c | 3 +-
drivers/of/selftest.c | 62 +++
drivers/of/testcase-data/tests-phandle.dtsi | 3 +
fs/proc/Makefile | 1 -
fs/proc/internal.h | 7 -
fs/proc/proc_devtree.c | 241 -----------
fs/proc/root.c | 3 -
include/asm-generic/vmlinux.lds.h | 11 +
include/linux/of.h | 61 ++-
include/linux/of_fdt.h | 4 +
include/linux/of_reserved_mem.h | 53 +++
scripts/Makefile.lib | 12 +
scripts/dtc/dtc-parser.tab.c_shipped | 469 +++++++++------------
scripts/dtc/dtc-parser.tab.h_shipped | 36 +-
scripts/dtc/dtc.c | 119 +++---
scripts/dtc/dtc.h | 1 -
scripts/dtc/srcpos.c | 6 +-
scripts/dtc/update-dtc-source.sh | 54 +++
scripts/dtc/util.c | 141 ++++++-
scripts/dtc/util.h | 107 ++++-
scripts/dtc/version_gen.h | 2 +-
44 files changed, 1555 insertions(+), 727 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-firmware-ofw
create mode 100644
Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
create mode 100644 drivers/of/of_reserved_mem.c
delete mode 100644 fs/proc/proc_devtree.c
create mode 100644 include/linux/of_reserved_mem.h
create mode 100755 scripts/dtc/update-dtc-source.sh


2014-04-01 19:42:42

by Paul Bolle

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Tue, 2014-04-01 at 11:15 +0100, Grant Likely wrote:
> Grant Likely (13):
> [...]
> of: remove /proc/device-tree

That commit leaves a select for PROC_DEVICETREE dangling. See "config
ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
statement just be dropped now or is something more elaborate needed?


Paul Bolle

2014-04-01 20:18:39

by Rob Herring

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Tue, Apr 1, 2014 at 2:42 PM, Paul Bolle <[email protected]> wrote:
> On Tue, 2014-04-01 at 11:15 +0100, Grant Likely wrote:
>> Grant Likely (13):
>> [...]
>> of: remove /proc/device-tree
>
> That commit leaves a select for PROC_DEVICETREE dangling. See "config
> ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
> statement just be dropped now or is something more elaborate needed?

Yes, it can and should be dropped. It never should have been there to
begin with. It should be a user selectable option, not a platform
selection.

Rob

2014-04-01 20:34:06

by Paul Bolle

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Tue, 2014-04-01 at 15:18 -0500, Rob Herring wrote:
> On Tue, Apr 1, 2014 at 2:42 PM, Paul Bolle <[email protected]> wrote:
> > That commit leaves a select for PROC_DEVICETREE dangling. See "config
> > ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
> > statement just be dropped now or is something more elaborate needed?
>
> Yes, it can and should be dropped. It never should have been there to
> begin with. It should be a user selectable option, not a platform
> selection.

Should I draft a (trivial) patch to drop it or would you like to do
that? (Your commit explanation will probably end up more useful.)


Paul Bolle

2014-04-01 20:38:24

by Grant Likely

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Tue, 01 Apr 2014 21:42:37 +0200, Paul Bolle <[email protected]> wrote:
> On Tue, 2014-04-01 at 11:15 +0100, Grant Likely wrote:
> > Grant Likely (13):
> > [...]
> > of: remove /proc/device-tree
>
> That commit leaves a select for PROC_DEVICETREE dangling. See "config
> ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
> statement just be dropped now or is something more elaborate needed?

I'll fix that up and submit a cleanup today. A dangling select should
not break the build.

g.

2014-04-01 20:40:03

by Grant Likely

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

Linus, I've fixed up the pull request. Here is the new tag:

The following changes since commit fa389e220254c69ffae0d403eac4146171062d08:

Linux 3.14-rc6 (2014-03-09 19:41:57 -0700)

are available in the git repository at:

git://git.secretlab.ca/git/linux tags/dt-for-linus

for you to fetch changes up to a0e7398357f297dd22d043fb2d5aa1c44d61ca10:

dt: Remove dangling "select PROC_DEVICETREE" (2014-04-01 21:33:35 +0100)

----------------------------------------------------------------
Devicetree changes for v3.15

Updates to devicetree core code. This branch contains the following
notable changes:
* Add reserved memory binding
* Make struct device_node a kobject and remove legacy /proc/device-tree
* ePAPR conformance fixes
* Update in-kernel DTC copy to version v1.4.0
* Preparation changes for dynamic device tree overlays
* minor bug fixes and documentation changes

The most significant change in this branch is the conversion of struct
device_node to be a kobject that is exposed via sysfs and removal of the
old /proc/device-tree code. This simplifies the device tree handling
code and tightens up the lifecycle on device tree nodes.

[updated: added fix for dangling select PROC_DEVICETREE]

----------------------------------------------------------------
Andreas Herrmann (1):
of: Increase MAX_PHANDLE_ARGS

Florian Fainelli (1):
of: make of_get_phy_mode parse 'phy-connection-type'

Florian Vaussard (2):
of: add vendor prefix for SMSC
of: add missing major vendors

Grant Likely (14):
scripts/dtc: Update shipped files to build with bison 2.7.12
scripts/dtc: Update to upstream version v1.4.0
scripts/dtc: Add a script to update to mainline dtc source
Merge branch 'devicetree/dtc' into devicetree/next
Revert "of: fix of_update_property()"
Merge tag 'v3.14-rc5' into HEAD
of: document bindings for reserved-memory nodes
of: Make device nodes kobjects so they show up in sysfs
of/selftest: Add self tests for manipulation of properties
of: remove /proc/device-tree
Merge branch 'devicetree/next-reserved-mem' into devicetree/next
of: Add support for ePAPR "stdout-path" property
Merge remote-tracking branch 'robh/for-next' into devicetree/next
dt: Remove dangling "select PROC_DEVICETREE"

Gregory CLEMENT (2):
of: Allows to use the PCI translator without the PCI core
ARM: mvebu: Allows to get the SoC ID even without PCI enabled

Jason Cooper (1):
kbuild: dtbs_install: new make target

Josh Cartwright (1):
of: only scan for reserved mem when fdt present

Marek Szyprowski (6):
drivers: of: add initialization code for static reserved memory
drivers: of: add initialization code for dynamic reserved memory
drivers: of: add support for custom reserved memory drivers
arm: add support for reserved memory defined by device tree
arm64: add support for reserved memory defined by device tree
powerpc: add support for reserved memory defined by device tree

Pantelis Antoniou (3):
of: Introduce device tree node flag helpers.
of: Clear detach flag on attach
of: device_node kobject lifecycle fixes

Xiubo Li (2):
of: add __of_add_property() without lock operations
of: fix of_update_property()

Documentation/ABI/testing/sysfs-firmware-ofw | 28 ++
.../bindings/reserved-memory/reserved-memory.txt | 133 ++++++
.../devicetree/bindings/vendor-prefixes.txt | 17 +
Makefile | 7 +
arch/arm/Kconfig | 1 +
arch/arm/Makefile | 7 +-
arch/arm/boot/dts/Makefile | 4 +-
arch/arm/mach-mvebu/Kconfig | 1 +
arch/arm/mach-omap2/Kconfig | 1 -
arch/arm/mm/init.c | 2 +
arch/arm64/Kconfig | 1 +
arch/arm64/mm/init.c | 1 +
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/prom.c | 3 +
arch/powerpc/platforms/pseries/dlpar.c | 2 -
arch/powerpc/platforms/pseries/reconfig.c | 2 -
arch/powerpc/sysdev/msi_bitmap.c | 2 +-
drivers/of/Kconfig | 18 +-
drivers/of/Makefile | 1 +
drivers/of/address.c | 8 +-
drivers/of/base.c | 274 +++++++++---
drivers/of/fdt.c | 145 ++++++-
drivers/of/of_net.c | 11 +-
drivers/of/of_reserved_mem.c | 217 ++++++++++
drivers/of/pdt.c | 3 +-
drivers/of/selftest.c | 62 +++
drivers/of/testcase-data/tests-phandle.dtsi | 3 +
fs/proc/Makefile | 1 -
fs/proc/internal.h | 7 -
fs/proc/proc_devtree.c | 241 -----------
fs/proc/root.c | 3 -
include/asm-generic/vmlinux.lds.h | 11 +
include/linux/of.h | 61 ++-
include/linux/of_fdt.h | 4 +
include/linux/of_reserved_mem.h | 53 +++
scripts/Makefile.lib | 12 +
scripts/dtc/dtc-parser.tab.c_shipped | 469 +++++++++------------
scripts/dtc/dtc-parser.tab.h_shipped | 36 +-
scripts/dtc/dtc.c | 119 +++---
scripts/dtc/dtc.h | 1 -
scripts/dtc/srcpos.c | 6 +-
scripts/dtc/update-dtc-source.sh | 54 +++
scripts/dtc/util.c | 141 ++++++-
scripts/dtc/util.h | 107 ++++-
scripts/dtc/version_gen.h | 2 +-
45 files changed, 1555 insertions(+), 728 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-firmware-ofw
create mode 100644
Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
create mode 100644 drivers/of/of_reserved_mem.c
delete mode 100644 fs/proc/proc_devtree.c
create mode 100644 include/linux/of_reserved_mem.h
create mode 100755 scripts/dtc/update-dtc-source.sh

On Tue, Apr 1, 2014 at 1:32 PM, Grant Likely <[email protected]> wrote:
> On Tue, 01 Apr 2014 21:42:37 +0200, Paul Bolle <[email protected]> wrote:
>> On Tue, 2014-04-01 at 11:15 +0100, Grant Likely wrote:
>> > Grant Likely (13):
>> > [...]
>> > of: remove /proc/device-tree
>>
>> That commit leaves a select for PROC_DEVICETREE dangling. See "config
>> ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
>> statement just be dropped now or is something more elaborate needed?
>
> I'll fix that up and submit a cleanup today. A dangling select should
> not break the build.
>
> g.
>

2014-04-01 20:46:18

by Paul Bolle

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Tue, 2014-04-01 at 21:32 +0100, Grant Likely wrote:
> On Tue, 01 Apr 2014 21:42:37 +0200, Paul Bolle <[email protected]> wrote:
> > That commit leaves a select for PROC_DEVICETREE dangling. See "config
> > ARCH_OMAP2PLUS" in arch/arm/mach-omap2/Kconfig. Can that select
> > statement just be dropped now or is something more elaborate needed?
>
> I'll fix that up and submit a cleanup today. A dangling select should
> not break the build.

It doesn't, as far as I know. But perhaps the kconfig tools should warn
about select statements for non-existent Kconfig symbols.


Paul Bolle

2014-10-27 15:39:11

by Linus Walleij

[permalink] [raw]
Subject: Re: [git pull] Devicetree changes for v3.15

On Mon, Sep 29, 2014 at 10:52 AM, Linus Walleij
<[email protected]> wrote:
> On Fri, Sep 26, 2014 at 4:19 PM, Jason Cooper <[email protected]> wrote:
>> On Fri, Sep 26, 2014 at 02:30:53PM +0200, Linus Walleij wrote:
>
>> Exact patch is:
>>
>> f4d4ffc03efc kbuild: dtbs_install: new make target
>>
>>> 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.
>>>
>>> Do you think this can be fixed? It's quite simple to reproduce...
>>
>> Does the attached fix your problem?
>
> Yes!
> Tested-by: Linus Walleij <[email protected]>
>
> Please get this upstream marked for stable.

So is there a proper fix for this coming or not?

I am suffering from this problem :-(

Yours,
Linus Walleij

2014-11-02 20:53:15

by Jason Cooper

[permalink] [raw]
Subject: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

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 <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Jason Cooper <[email protected]>
---
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
--
2.1.3

2014-11-25 21:41:40

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

Dne 2.11.2014 v 21:52 Jason Cooper napsal(a):
> 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.

If a mere 'make prepare' causes a rebuild of the whole kernel, then
there is something fishy in the ARM Makefiles. However, if you only need
the KERNELRELEASE variable, then you do not need to depend on prepare.
The main Makefile makes sure that silentoldconfig is ran and therefore
KERNELRELEASE set for all targets except make *config.

Michal

2014-11-25 23:52:04

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Tue, Nov 25, 2014 at 10:41:35PM +0100, Michal Marek wrote:
> Dne 2.11.2014 v 21:52 Jason Cooper napsal(a):
> > 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.
>
> If a mere 'make prepare' causes a rebuild of the whole kernel, then
> there is something fishy in the ARM Makefiles. However, if you only need
> the KERNELRELEASE variable, then you do not need to depend on prepare.
> The main Makefile makes sure that silentoldconfig is ran and therefore
> KERNELRELEASE set for all targets except make *config.

Running make prepare and then re-running a build doesn't rebuild anything
for me. However, I always build with O= Also works if I do a make
dtbs too. So, everything seems to work as expected here.

I think this needs a bit more debugging to see why the whole kernel is
being rebuilt - the kernel build system has methods to tell you why stuff
is being built, which would be a good place to start.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

2014-11-26 00:57:27

by Jason Cooper

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Tue, Nov 25, 2014 at 11:51:50PM +0000, Russell King - ARM Linux wrote:
> On Tue, Nov 25, 2014 at 10:41:35PM +0100, Michal Marek wrote:
> > Dne 2.11.2014 v 21:52 Jason Cooper napsal(a):
> > > 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.
> >
> > If a mere 'make prepare' causes a rebuild of the whole kernel, then
> > there is something fishy in the ARM Makefiles. However, if you only need
> > the KERNELRELEASE variable, then you do not need to depend on prepare.
> > The main Makefile makes sure that silentoldconfig is ran and therefore
> > KERNELRELEASE set for all targets except make *config.
>
> Running make prepare and then re-running a build doesn't rebuild anything
> for me. However, I always build with O= Also works if I do a make
> dtbs too. So, everything seems to work as expected here.
>
> I think this needs a bit more debugging to see why the whole kernel is
> being rebuilt - the kernel build system has methods to tell you why stuff
> is being built, which would be a good place to start.

Linus, since you were the one experiencing the regression, care to take
a whack at that?

thx,

Jason.

2014-11-26 09:39:53

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On 2014-11-26 00:51, Russell King - ARM Linux wrote:
> On Tue, Nov 25, 2014 at 10:41:35PM +0100, Michal Marek wrote:
>> Dne 2.11.2014 v 21:52 Jason Cooper napsal(a):
>>> 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.
>>
>> If a mere 'make prepare' causes a rebuild of the whole kernel, then
>> there is something fishy in the ARM Makefiles. However, if you only need
>> the KERNELRELEASE variable, then you do not need to depend on prepare.
>> The main Makefile makes sure that silentoldconfig is ran and therefore
>> KERNELRELEASE set for all targets except make *config.
>
> Running make prepare and then re-running a build doesn't rebuild anything
> for me. However, I always build with O= Also works if I do a make
> dtbs too. So, everything seems to work as expected here.

Good :).


> I think this needs a bit more debugging to see why the whole kernel is
> being rebuilt - the kernel build system has methods to tell you why stuff
> is being built, which would be a good place to start.

Right, this is make V=2.

Michal

2014-11-26 13:57:45

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Wed, Nov 26, 2014 at 1:57 AM, Jason Cooper <[email protected]> wrote:
> On Tue, Nov 25, 2014 at 11:51:50PM +0000, Russell King - ARM Linux wrote:

>> I think this needs a bit more debugging to see why the whole kernel is
>> being rebuilt - the kernel build system has methods to tell you why stuff
>> is being built, which would be a good place to start.
>
> Linus, since you were the one experiencing the regression, care to take
> a whack at that?

OK this full example should be possible to repeat for anyone
with a cross compiler, and uses a separate build dir, and yeah
there was something fishy: the bug only appears if you specify
CONFIG_DEBUG_SECTION_MISMATCH=y:

make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 u300_defconfig
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage

-> no rebuild, just relink

make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 u300_defconfig
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y

-> no rebuild, just relink

make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 u300_defconfig
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 dtbs
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage

-> no rebuild, just relink

make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 u300_defconfig
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 dtbs
make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y

-> Rebuilds everything.

This doesn't occur before the offending commit. So it only happens
when specifying extra
environment variables on the command line.

So I can get rid of the rebuilding by making my scripts less
strict by removing CONFIG_DEBUG_SECTION_MISMATCH=y.

But is this really correct?

Two last examples with more detail:

make[1]: Entering directory `/home/linus/linux/build-u300'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
Using .. as source for kernel
make[2]: `include/generated/mach-types.h' is up to date.
CALL ../scripts/checksyscalls.sh - due to target missing
CHK include/generated/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
make[1]: Leaving directory `/home/linus/linux/build-u300'

make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y V=2

make[1]: Entering directory `/home/linus/linux/build-u300'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
Using .. as source for kernel
CC scripts/mod/empty.o - due to command line change
CC scripts/mod/devicetable-offsets.s - due to command line change
MKELF scripts/mod/elfconfig.h - due to: scripts/mod/empty.o
HOSTCC scripts/mod/modpost.o - due to: scripts/mod/elfconfig.h
HOSTCC scripts/mod/sumversion.o - due to: scripts/mod/elfconfig.h
GEN scripts/mod/devicetable-offsets.h - due to:
scripts/mod/devicetable-offsets.s
HOSTCC scripts/mod/file2alias.o - due to: scripts/mod/elfconfig.h
scripts/mod/devicetable-offsets.h
HOSTLD scripts/mod/modpost - due to: scripts/mod/modpost.o
scripts/mod/file2alias.o scripts/mod/sumversion.o
make[2]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s - due to command line change
GEN include/generated/bounds.h - due to: kernel/bounds.s
CC arch/arm/kernel/asm-offsets.s - due to: include/generated/bounds.h
GEN include/generated/asm-offsets.h - due to:
arch/arm/kernel/asm-offsets.s
CALL ../scripts/checksyscalls.sh - due to target missing
CC init/main.o - due to: include/generated/bounds.h
CC arch/arm/common/firmware.o - due to: include/generated/bounds.h
CC arch/arm/mm/dma-mapping.o - due to: include/generated/bounds.h
CC arch/arm/kernel/elf.o - due to: include/generated/bounds.h
CC arch/arm/mach-u300/core.o - due to: include/generated/bounds.h
AS arch/arm/kernel/entry-common.o - due to:
include/generated/asm-offsets.h
LD arch/arm/common/built-in.o - due to: arch/arm/common/firmware.o
CHK include/generated/compile.h
CC arch/arm/kernel/irq.o - due to: include/generated/bounds.h
CC arch/arm/mach-u300/dummyspichip.o - due to: include/generated/bounds.h
CC init/do_mounts.o - due to: include/generated/bounds.h
CC arch/arm/mm/extable.o - due to: include/generated/bounds.h
CC arch/arm/kernel/opcodes.o - due to: include/generated/bounds.h
(...)

If I revert commit f4d4ffc03efc:

make[1]: Entering directory `/home/linus/linux/build-u300'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
Using .. as source for kernel
CHK include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
CC scripts/mod/empty.o - due to command line change
CC scripts/mod/devicetable-offsets.s - due to command line change
CALL ../scripts/checksyscalls.sh - due to target missing
MKELF scripts/mod/elfconfig.h - due to: scripts/mod/empty.o
HOSTCC scripts/mod/modpost.o - due to: scripts/mod/elfconfig.h
HOSTCC scripts/mod/sumversion.o - due to: scripts/mod/elfconfig.h
GEN scripts/mod/devicetable-offsets.h - due to:
scripts/mod/devicetable-offsets.s
HOSTCC scripts/mod/file2alias.o - due to: scripts/mod/elfconfig.h
scripts/mod/devicetable-offsets.h
HOSTLD scripts/mod/modpost - due to: scripts/mod/modpost.o
scripts/mod/file2alias.o scripts/mod/sumversion.o
CHK include/generated/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
make[1]: Leaving directory `/home/linus/linux/build-u300'

So in both cases a changed command line is detected and
empty.o and devicetable-offsets.s is rebuilt.

But after the commit the rebuild goes on to rebuild
kernel/bounds.s which generates bounds.h which in
turn rebuilds the whole world.

I don't know why the behaviour changed like this :(

Yours,
Linus Walleij

2014-11-26 14:42:11

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Wed, Nov 26, 2014 at 02:57:42PM +0100, Linus Walleij wrote:
> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> KBUILD_OUTPUT=build-u300 u300_defconfig
> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> KBUILD_OUTPUT=build-u300 dtbs
> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
>
> -> Rebuilds everything.
>
> This doesn't occur before the offending commit. So it only happens
> when specifying extra environment variables on the command line.

I suspect if you also provide the CONFIG_DEBUG_SECTION_MISMATCH=y on the
dtbs line, everything will work properly.

The problem is that dtbs line executes a prepare, which I guess rebuilds
the bounds stuff. So, the dtbs target results in it being rebuilt without
the section mismatch, and then you re-execute a make with it, causing
the bounds stuff to be rebuilt again.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

2014-11-28 14:10:32

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Wed, Nov 26, 2014 at 3:41 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Wed, Nov 26, 2014 at 02:57:42PM +0100, Linus Walleij wrote:
>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>> KBUILD_OUTPUT=build-u300 u300_defconfig
>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>> KBUILD_OUTPUT=build-u300 dtbs
>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
>>
>> -> Rebuilds everything.
>>
>> This doesn't occur before the offending commit. So it only happens
>> when specifying extra environment variables on the command line.
>
> I suspect if you also provide the CONFIG_DEBUG_SECTION_MISMATCH=y on the
> dtbs line, everything will work properly.

Yay, it works! :)

> The problem is that dtbs line executes a prepare, which I guess rebuilds
> the bounds stuff. So, the dtbs target results in it being rebuilt without
> the section mismatch, and then you re-execute a make with it, causing
> the bounds stuff to be rebuilt again.

Yep. Not very intuitive to require passing section mismatch debug
flags to DTB rebuilding but whatever, it's not so bad I can't live with
it.

Strange that it worked before.

Yours,
Linus Walleij

2014-12-01 13:55:52

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On 2014-11-28 15:10, Linus Walleij wrote:
> On Wed, Nov 26, 2014 at 3:41 PM, Russell King - ARM Linux
> <[email protected]> wrote:
>> On Wed, Nov 26, 2014 at 02:57:42PM +0100, Linus Walleij wrote:
>>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>>> KBUILD_OUTPUT=build-u300 u300_defconfig
>>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
>>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>>> KBUILD_OUTPUT=build-u300 dtbs
>>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
>>>
>>> -> Rebuilds everything.
>>>
>>> This doesn't occur before the offending commit. So it only happens
>>> when specifying extra environment variables on the command line.
>>
>> I suspect if you also provide the CONFIG_DEBUG_SECTION_MISMATCH=y on the
>> dtbs line, everything will work properly.
>
> Yay, it works! :)
>
>> The problem is that dtbs line executes a prepare, which I guess rebuilds
>> the bounds stuff. So, the dtbs target results in it being rebuilt without
>> the section mismatch, and then you re-execute a make with it, causing
>> the bounds stuff to be rebuilt again.
>
> Yep. Not very intuitive to require passing section mismatch debug
> flags to DTB rebuilding but whatever, it's not so bad I can't live with
> it.

Still, the dependency on the 'prepare' target is superfluous, if the
only requirement is that $(KERNELRELEASE) be set properly.

Michal

2014-12-04 11:22:12

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Mon, 01 Dec 2014 14:55:48 +0100
, Michal Marek <[email protected]>
wrote:
> On 2014-11-28 15:10, Linus Walleij wrote:
> > On Wed, Nov 26, 2014 at 3:41 PM, Russell King - ARM Linux
> > <[email protected]> wrote:
> >> On Wed, Nov 26, 2014 at 02:57:42PM +0100, Linus Walleij wrote:
> >>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> >>> KBUILD_OUTPUT=build-u300 u300_defconfig
> >>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> >>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
> >>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> >>> KBUILD_OUTPUT=build-u300 dtbs
> >>> make -f Makefile -j5 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> >>> KBUILD_OUTPUT=build-u300 zImage CONFIG_DEBUG_SECTION_MISMATCH=y
> >>>
> >>> -> Rebuilds everything.
> >>>
> >>> This doesn't occur before the offending commit. So it only happens
> >>> when specifying extra environment variables on the command line.
> >>
> >> I suspect if you also provide the CONFIG_DEBUG_SECTION_MISMATCH=y on the
> >> dtbs line, everything will work properly.
> >
> > Yay, it works! :)
> >
> >> The problem is that dtbs line executes a prepare, which I guess rebuilds
> >> the bounds stuff. So, the dtbs target results in it being rebuilt without
> >> the section mismatch, and then you re-execute a make with it, causing
> >> the bounds stuff to be rebuilt again.
> >
> > Yep. Not very intuitive to require passing section mismatch debug
> > flags to DTB rebuilding but whatever, it's not so bad I can't live with
> > it.
>
> Still, the dependency on the 'prepare' target is superfluous, if the
> only requirement is that $(KERNELRELEASE) be set properly.

So, I've lost track of where things stand on this issue. What is the
current proposed fix? Make dtbs depend on 'scripts' and dtbs_install
depend on 'prepare scripts'? Or is there a better way to make sure
KERNELRELEASE is set for the dtbs_install target?

g.

2014-12-04 11:25:10

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM: kbuild: Fix forced rebuild after 'make dtbs'

On Thu, Dec 04, 2014 at 11:22:01AM +0000, Grant Likely wrote:
> On Mon, 01 Dec 2014 14:55:48 +0100, Michal Marek <[email protected]> wrote:
> > Still, the dependency on the 'prepare' target is superfluous, if the
> > only requirement is that $(KERNELRELEASE) be set properly.
>
> So, I've lost track of where things stand on this issue. What is the
> current proposed fix? Make dtbs depend on 'scripts' and dtbs_install
> depend on 'prepare scripts'? Or is there a better way to make sure
> KERNELRELEASE is set for the dtbs_install target?

Marek's first reply in the thread contains the solution:

if you only need
the KERNELRELEASE variable, then you do not need to depend on prepare.
The main Makefile makes sure that silentoldconfig is ran and therefore
KERNELRELEASE set for all targets except make *config.

which seems to suggest that "prepare" is not needed for either target.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.