linux/drivers/of
Frank Rowand 39a751a4cb of: change overlay apply input data from unflattened to FDT
Move duplicating and unflattening of an overlay flattened devicetree
(FDT) into the overlay application code.  To accomplish this,
of_overlay_apply() is replaced by of_overlay_fdt_apply().

The copy of the FDT (aka "duplicate FDT") now belongs to devicetree
code, which is thus responsible for freeing the duplicate FDT.  The
caller of of_overlay_fdt_apply() remains responsible for freeing the
original FDT.

The unflattened devicetree now belongs to devicetree code, which is
thus responsible for freeing the unflattened devicetree.

These ownership changes prevent early freeing of the duplicated FDT
or the unflattened devicetree, which could result in use after free
errors.

of_overlay_fdt_apply() is a private function for the anticipated
overlay loader.

Update unittest.c to use of_overlay_fdt_apply() instead of
of_overlay_apply().

Move overlay fragments from artificial locations in
drivers/of/unittest-data/tests-overlay.dtsi into one devicetree
source file per overlay.  This led to changes in
drivers/of/unitest-data/Makefile and drivers/of/unitest.c.

  - Add overlay directives to the overlay devicetree source files so
    that dtc will compile them as true overlays into one FDT data
    chunk per overlay.

  - Set CFLAGS for drivers/of/unittest-data/testcases.dts so that
    symbols will be generated for overlay resolution of overlays
    that are no longer artificially contained in testcases.dts

  - Unflatten and apply each unittest overlay FDT using
    of_overlay_fdt_apply().

  - Enable the of_resolve_phandles() check for whether the unflattened
    overlay is detached.  This check was previously disabled because the
    overlays from tests-overlay.dtsi were not unflattened into detached
    trees.

  - Other changes to unittest.c infrastructure to manage multiple test
    FDTs built into the kernel image (access by name instead of
    arbitrary number).

  - of_unittest_overlay_high_level(): previously unused code to add
    properties from the overlay_base devicetree to the live tree
    was triggered by the restructuring of tests-overlay.dtsi and thus
    testcases.dts.  This exposed two bugs: (1) the need to dup a
    property before adding it, and (2) property 'name' is
    auto-generated in the unflatten code and thus will be a duplicate
    in the __symbols__ node - do not treat this duplicate as an error.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
2018-03-04 00:29:24 -08:00
..
unittest-data of: change overlay apply input data from unflattened to FDT 2018-03-04 00:29:24 -08:00
address.c pci-v4.16-changes 2018-02-06 09:59:40 -08:00
base.c DeviceTree updates for 4.16: 2018-02-01 10:57:45 -08:00
device.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
dynamic.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt.c of/fdt: use memblock_virt_alloc for early alloc 2018-01-08 08:24:34 -06:00
irq.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
Kconfig of: change overlay apply input data from unflattened to FDT 2018-03-04 00:29:24 -08:00
kobj.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
Makefile PCI: Move OF-related PCI functions into PCI core 2018-01-17 17:36:39 -06:00
of_mdio.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-11 22:13:42 -05:00
of_net.c of_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
of_numa.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
of_private.h of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
of_reserved_mem.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
overlay.c of: change overlay apply input data from unflattened to FDT 2018-03-04 00:29:24 -08:00
pdt.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
platform.c ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
property.c DeviceTree updates for 4.16: 2018-02-01 10:57:45 -08:00
resolver.c of: change overlay apply input data from unflattened to FDT 2018-03-04 00:29:24 -08:00
unittest.c of: change overlay apply input data from unflattened to FDT 2018-03-04 00:29:24 -08:00