linux-stable/drivers/of
Frank Rowand d1651b03c2 of: overlay: add overlay symbols to live device tree
Add overlay __symbols__ properties to live tree when an overlay
is added to the live tree so that the symbols are available to
subsequent overlays.

Expected test result is new __symbols__ entries for labels from
the overlay after this commit.

Before this commit:

   Console error message near end of unittest:
      ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed
      ### dt-test ### end of unittest - 190 passed, 1 failed

   The new unittest "fails" because the expected result of loading the
   new overlay is an error instead of success.

   $ # node hvac-medium-2 exists because the overlay loaded
   $ # since the duplicate symbol was not detected
   $ cd /proc/device-tree/testcase-data-2/substation@100/
   $ ls
   compatible     hvac-medium-2  motor-8        reg
   hvac-large-1   linux,phandle  name           status
   hvac-medium-1  motor-1        phandle

   $ cd /proc/device-tree/__symbols__/
   $ ls
   electric_1   lights_1     name         rides_1      spin_ctrl_2
   hvac_1       lights_2     retail_1     spin_ctrl_1

After this commit:

   Previous console error message no longer occurs, but expected error
   occurs:
      OF: overlay: Failed to apply prop @/__symbols__/hvac_1
      OF: overlay: apply failed '/__symbols__'
      ### dt-test ### end of unittest - 191 passed, 0 failed

   $ # node hvac-medium-2 does not exist because the overlay
   $ # properly failed to load due to the duplicate symbol
   $ cd /proc/device-tree/testcase-data-2/substation@100/
   $ ls
   compatible     hvac-medium-1  motor-1        name           reg
   hvac-large-1   linux,phandle  motor-8        phandle        status

   $ cd /proc/device-tree/__symbols__/
   $ ls
   electric_1      lights_1        retail_1        ride_200_right  spin_ctrl_2
   hvac_1          lights_2        ride_200        rides_1
   hvac_2          name            ride_200_left   spin_ctrl_1
   $ cat ride_200; echo
   /testcase-data-2/fairway-1/ride@200
   $ cat ride_200_left ; echo
   /testcase-data-2/fairway-1/ride@200/track@10
   $ cat ride_200_right ; echo
   /testcase-data-2/fairway-1/ride@200/track@20

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-07-20 09:40:05 -05:00
..
unittest-data of: overlay: add overlay unittest data for node names and symbols 2017-07-20 09:36:13 -05:00
address.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
base.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
device.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
dynamic.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
fdt.c DeviceTree for 4.13: 2017-07-07 10:37:54 -07:00
fdt_address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
irq.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
Kconfig mtd: Kill the OF_MTD Kconfig option 2016-09-23 09:35:16 +02:00
Makefile of: Move OF property and graph API from base.c to property.c 2017-06-01 08:50:45 -05:00
of_mdio.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -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: fix "/cpus" reference leak in of_numa_parse_cpu_nodes() 2017-04-18 11:04:12 -05:00
of_pci.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -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_private.h of: find_node_by_full_name rewrite to compare each level 2017-06-22 12:38:29 -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: add overlay symbols to live device tree 2017-07-20 09:40:05 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
property.c of: Convert to using %pOF instead of full_name 2017-07-18 17:09:18 -05:00
resolver.c of: find_node_by_full_name rewrite to compare each level 2017-06-22 12:38:29 -05:00
unittest.c of: overlay: add overlay unittest data for node names and symbols 2017-07-20 09:36:13 -05:00