linux/drivers/of
Stephan Gerhold 4cea282188 of: reserved_mem: Use stable allocation order
sort() in Linux is based on heapsort which is not a stable sort
algorithm - equal elements are being reordered. For reserved memory in
the device tree this happens mainly for dynamic allocations: They do not
have an address to sort with, so they are reordered somewhat randomly
when adding/removing other unrelated reserved memory nodes.

Functionally this is not a big problem, but it's confusing during
development when all the addresses change after adding unrelated
reserved memory nodes.

Make the order stable by sorting dynamic allocations according to
the node order in the device tree. Static allocations are not affected
by this because they are still sorted by their (fixed) address.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20230510-dt-resv-bottom-up-v2-2-aeb2afc8ac25@gerhold.net
Signed-off-by: Rob Herring <robh@kernel.org>
2023-06-20 09:34:58 -06:00
..
unittest-data of/address: Add support for 3 address cell bus 2023-04-13 17:46:35 -05:00
address.c dma-mapping updates for Linux 6.4 2023-04-29 10:29:57 -07:00
base.c Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
cpu.c of: Move CPU node related functions to their own file 2023-04-13 17:46:34 -05:00
device.c of: device: Kill of_device_request_module() 2023-04-05 19:41:11 +02:00
dynamic.c Devicetree fixes for v6.2, part 3: 2023-04-13 15:21:56 -07:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt.c Devicetree fixes for 6.4, part 1: 2023-05-05 13:27:59 -07:00
irq.c of/irq: add missing of_node_put() for interrupt parent node 2023-01-18 11:31:42 -06:00
Kconfig of: address: always use dma_default_coherent for default coherency 2023-04-07 07:38:28 +02:00
kexec.c of/kexec: Fix reading 32-bit "linux,initrd-{start,end}" values 2022-12-06 14:50:36 -06:00
kobj.c of: make of_node_ktype constant 2023-02-06 11:03:00 -06:00
Makefile Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
module.c of: Move the request module helper logic to module.c 2023-04-05 19:41:10 +02:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of: Make devtree_lock declaration private 2023-04-10 18:32:31 -05:00
of_reserved_mem.c of: reserved_mem: Use stable allocation order 2023-06-20 09:34:58 -06:00
overlay.c of: overlay: Fix trivial typo 2022-12-26 16:09:29 -06:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c of/platform: Propagate firmware node by calling device_set_node() 2023-06-15 10:48:19 -06:00
property.c Devicetree updates for v6.3: 2023-02-24 13:31:53 -08:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c of: unittest: Switch i2c driver back to use .probe() 2023-06-12 13:31:21 -06:00