linux/drivers/of
Stephen Boyd 6e0391e48c of: Skip kunit tests when arm64+ACPI doesn't populate root node
A root node is required to apply DT overlays. A root node is usually
present after commit 7b937cc243 ("of: Create of_root if no dtb
provided by firmware"), except for on arm64 systems booted with ACPI
tables. In that case, the root node is intentionally not populated
because it would "allow DT devices to be instantiated atop an ACPI base
system"[1].

Introduce an OF function that skips the kunit test if the root node
isn't populated. Limit the test to when both CONFIG_ARM64 and
CONFIG_ACPI are set, because otherwise the lack of a root node is a bug.
Make the function private and take a kunit test parameter so that it
can't be abused to test for the presence of the root node in non-test
code.

Use this function to skip tests that require the root node. Currently
that's the DT tests and any tests that apply overlays.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/r/6cd337fb-38f0-41cb-b942-5844b84433db@roeck-us.net
Link: https://lore.kernel.org/r/Zd4dQpHO7em1ji67@FVFF77S0Q05N.cambridge.arm.com [1]
Fixes: 893ecc6d2d ("of: Add KUnit test to confirm DTB is loaded")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20241009204133.1169931-1-sboyd@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-10-10 12:43:01 -05:00
..
unittest-data of: Fix double free in of_parse_phandle_with_args_map 2024-01-09 12:54:02 -06:00
.kunitconfig of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
address.c of: address: Unify resource bounds overflow checking 2024-09-13 14:00:52 -05:00
base.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
cpu.c
device.c OF: Simplify of_iommu_configure() 2024-07-04 14:36:04 +01:00
dynamic.c of: dynamic: Introduce of_changeset_add_prop_bool() 2024-07-08 17:40:30 -06:00
empty_root.dts of: Create of_root if no dtb provided by firmware 2024-03-08 12:50:39 -06:00
fdt_address.c
fdt.c kbuild: split device tree build rules into scripts/Makefile.dtbs 2024-09-09 23:42:13 +09:00
irq.c of/irq: Use helper to define resources 2024-09-13 14:52:28 -05:00
Kconfig of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
kexec.c arm64, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
kobj.c
kunit_overlay_test.dtso of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
Makefile of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
module.c Devicetree for v6.10: 2024-05-17 17:27:49 -07:00
of_kunit_helpers.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
of_numa.c of, numa: return -EINVAL when no numa-node-id is found 2024-09-03 21:15:32 -07:00
of_private.h of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
of_reserved_mem.c of: reserved_mem: Remove the use of phandle from the reserved_mem APIs 2024-05-03 07:49:13 -05:00
of_test.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
overlay_test.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
overlay.c of: overlay: Simplify with scoped for each OF child loop 2024-08-26 10:50:46 -05:00
pdt.c
platform.c The core clk framework is left largely untouched this time around except for 2024-09-23 15:01:48 -07:00
property.c drivers/of: Improve documentation for match_string 2024-09-13 14:01:34 -05:00
resolver.c of: resolver: Simplify with scoped for each OF child loop 2024-08-26 10:50:46 -05:00
unittest.c Kbuild updates for v6.12 2024-09-24 13:02:06 -07:00