linux-stable/drivers/of
Vincent Whitchurch ca05f33316 of: Fix reserved-memory overlap detection
The reserved-memory overlap detection code fails to detect overlaps if
either of the regions starts at address 0x0.  The code explicitly checks
for and ignores such regions, apparently in order to ignore dynamically
allocated regions which have an address of 0x0 at this point.  These
dynamically allocated regions also have a size of 0x0 at this point, so
fix this by removing the check and sorting the dynamically allocated
regions ahead of any static regions at address 0x0.

For example, there are two overlaps in this case but they are not
currently reported:

	foo@0 {
	        reg = <0x0 0x2000>;
	};

	bar@0 {
	        reg = <0x0 0x1000>;
	};

	baz@1000 {
	        reg = <0x1000 0x1000>;
	};

	quux {
	        size = <0x1000>;
	};

but they are after this patch:

 OF: reserved mem: OVERLAP DETECTED!
 bar@0 (0x00000000--0x00001000) overlaps with foo@0 (0x00000000--0x00002000)
 OF: reserved mem: OVERLAP DETECTED!
 foo@0 (0x00000000--0x00002000) overlaps with baz@1000 (0x00001000--0x00002000)

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/ded6fd6b47b58741aabdcc6967f73eca6a3f311e.1603273666.git-series.vincent.whitchurch@axis.com
Signed-off-by: Rob Herring <robh@kernel.org>
2020-10-25 20:37:55 -05:00
..
unittest-data of: unittest: Use bigger address cells to catch parser regressions 2020-08-03 16:24:49 -06:00
address.c dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00
base.c of: Export of_remove_property() to modules 2020-09-05 13:09:03 -07:00
device.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
dynamic.c of: of_detach_node() remove unneeded local return variable 2020-04-14 07:59:54 -05:00
fdt.c of/fdt: Remove redundant kbasename function call 2020-05-28 20:57:17 -06:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
irq.c of/irq: Make of_msi_map_rid() PCI bus agnostic 2020-07-28 15:51:32 +01:00
Kconfig net: phy: Move of_mdio from drivers/of to drivers/net/mdio 2020-10-10 10:55:05 -07:00
kobj.c of: Fix a refcounting bug in __of_attach_node_sysfs() 2020-05-27 19:30:25 -06:00
Makefile net: phy: Move of_mdio from drivers/of to drivers/net/mdio 2020-10-10 10:55:05 -07:00
of_net.c net: of_get_phy_mode: Change API to solve int/unit warnings 2019-11-04 11:21:25 -08:00
of_numa.c of, numa: Validate some distance map rules 2018-11-08 12:44:34 -06:00
of_private.h dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00
of_reserved_mem.c of: Fix reserved-memory overlap detection 2020-10-25 20:37:55 -05:00
overlay.c of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-17 08:31:34 -05:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c of: platform: Destroy child devices symmetrically 2020-08-17 20:19:35 -06:00
property.c drm next for 5.9-rc1 2020-08-05 19:50:06 -07:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c dma-mapping: introduce DMA range map, supplanting dma_pfn_offset 2020-09-17 18:43:56 +02:00