linux/drivers/of
Guenter Roeck f806238667 of/fdt: Add mutex protection for calls to __unflatten_device_tree()
__unflatten_device_tree() calls unflatten_dt_node(), which declares
a static variable. It is therefore not reentrant.

One of the callers of __unflatten_device_tree(), unflatten_device_tree(),
is only called once during early initialization and does not need to be
protected. The other caller, of_fdt_unflatten_tree(), can be called at
any time, possibly multiple times in parallel. This can happen, for
example, if multiple devicetree overlays have to be loaded and installed.

Without this protection, errors such as the following may be seen.

kernel: End of tree marker overwritten: e6a3a458
kernel: find_target_node:
	Failed to find target-indirect node at /fragment@0
kernel: __of_overlay_create: of_build_overlay_info() failed for tree@/

Add a mutex to of_fdt_unflatten_tree() to make the call reentrant.

Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org # v4.1+
Signed-off-by: Rob Herring <robh@kernel.org>
2015-12-08 09:50:42 -06:00
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
address.c of/address: fix typo in comment block of of_translate_one() 2015-11-30 17:57:01 -06:00
base.c of: simplify arch_find_n_match_cpu_physical_id() function 2015-10-30 13:04:19 -05:00
device.c of: to support binding numa node to specified device in devicetree 2015-10-17 22:11:50 -07:00
dynamic.c of/dynamic: Fix test for PPC_PSERIES 2015-06-05 10:39:28 +09:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
fdt.c of/fdt: Add mutex protection for calls to __unflatten_device_tree() 2015-12-08 09:50:42 -06:00
irq.c DeviceTree updates for 4.4: 2015-11-06 12:17:09 -08:00
Kconfig of: add config option to enable building of all dtbs 2015-10-27 16:12:13 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
of_mdio.c of_mdio: fix MDIO phy device refcounting 2015-09-24 23:04:52 -07:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -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_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_pci.c More power management and ACPI updates for v4.4-rc1 2015-11-12 11:50:33 -08:00
of_private.h of: Refactor __of_node_alloc() into __of_node_dup() 2014-11-24 22:24:41 +00:00
of_reserved_mem.c of: Fix comparison of reserved memory regions 2015-11-30 17:56:44 -06:00
overlay.c of/overlay: add missing of_node_put 2015-10-22 09:35:51 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: add missing of_node_put 2015-10-22 09:26:44 -05:00
resolver.c of/resolver: Switch to new local fixups format. 2014-11-24 22:24:50 +00:00
unittest.c of/unittest: add missing of_node_put 2015-10-22 09:26:28 -05:00