linux_dsm_epyc7002/drivers/of
Frank Rowand f948d6d8b7 of: overlay: avoid race condition between applying multiple overlays
The process of applying an overlay consists of:
  - unflatten an overlay FDT (flattened device tree) into an
    EDT (expanded device tree)
  - fixup the phandle values in the overlay EDT to fit in a
    range above the phandle values in the live device tree
  - create the overlay changeset to reflect the contents of
    the overlay EDT
  - apply the overlay changeset, to modify the live device tree,
    potentially changing the maximum phandle value in the live
    device tree

There is currently no protection against two overlay applies
concurrently determining what range of phandle values are in use
in the live device tree, and subsequently changing that range.
Add a mutex to prevent multiple overlay applies from occurring
simultaneously.

Move of_resolve_phandles() into of_overlay_apply() so that it does not
have to be duplicated by each caller of of_overlay_apply().

The test in of_resolve_phandles() that the overlay tree is detached is
temporarily disabled so that old style overlay unittests do not fail.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-10-17 20:47:27 -05:00
..
unittest-data devicetree: Adjust status "ok" -> "okay" under drivers/of/ 2017-09-05 10:05:41 -05:00
address.c of: remove unused pci_space variable from address.c 2017-07-21 10:46:15 -05:00
base.c of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
device.c dma-mapping updates for 4.14: 2017-09-12 13:30:06 -07:00
dynamic.c of: overlay: detect cases where device tree may become corrupt 2017-10-17 20:47:14 -05:00
fdt_address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
fdt.c of/fdt: Document detached argument to __unflatten_device_tree() 2017-10-16 16:49:18 -05:00
irq.c DeviceTree updates for 4.14: 2017-09-07 14:43:33 -07:00
Kconfig of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
kobj.c of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
Makefile of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
of_mdio.c DeviceTree updates for 4.14: 2017-09-07 14:43:33 -07: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: fix "/cpus" reference leak in of_numa_parse_cpu_nodes() 2017-04-18 11:04:12 -05:00
of_pci_irq.c OF/PCI: Update of_irq_parse_and_map_pci() comment 2017-07-02 16:14:28 -05:00
of_pci.c of_pci: use of_property_read_u32_array() 2017-07-24 10:00:52 -05:00
of_private.h of: overlay: avoid race condition between applying multiple overlays 2017-10-17 20:47:27 -05:00
of_reserved_mem.c Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code" 2017-05-11 10:26:22 -05:00
overlay.c of: overlay: avoid race condition between applying multiple overlays 2017-10-17 20:47:27 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of: Use PLATFORM_DEVID_NONE definition 2017-08-25 10:50:31 -05:00
property.c DeviceTree updates for 4.14: 2017-09-07 14:43:33 -07:00
resolver.c of: overlay: avoid race condition between applying multiple overlays 2017-10-17 20:47:27 -05:00
unittest.c of: overlay: avoid race condition between applying multiple overlays 2017-10-17 20:47:27 -05:00