drivers/of/of_kunit_helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Starting with commit 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by
probing DT devices when ACPI is used"), riscv images no longer populate
devicetree if ACPI is enabled. This causes unit tests to fail which require
the root node to be set.
# Subtest: of_dtb
# module: of_test
1..2
# of_dtb_root_node_found_by_path: EXPECTATION FAILED at drivers/of/of_test.c:21
Expected np is not null, but is
# of_dtb_root_node_found_by_path: pass:0 fail:1 skip:0 total:1
not ok 1 of_dtb_root_node_found_by_path
# of_dtb_root_node_populates_of_root: EXPECTATION FAILED at drivers/of/of_test.c:31
Expected of_root is not null, but is
# of_dtb_root_node_populates_of_root: pass:0 fail:1 skip:0 total:1
not ok 2 of_dtb_root_node_populates_of_root
Skip those tests for RISCV if the root node is not populated.
Fixes: 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by probing DT devices when ACPI is used")
Cc: Han Gao <rabenda.cn@gmail.com>
Cc: Paul Walmsley <pjw@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/of/of_kunit_helpers.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/of/of_kunit_helpers.c b/drivers/of/of_kunit_helpers.c
index 7b3ed5a382aa..f6ed1af8b62a 100644
--- a/drivers/of/of_kunit_helpers.c
+++ b/drivers/of/of_kunit_helpers.c
@@ -18,8 +18,9 @@
*/
void of_root_kunit_skip(struct kunit *test)
{
- if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ACPI) && !of_root)
- kunit_skip(test, "arm64+acpi doesn't populate a root node");
+ if ((IS_ENABLED(CONFIG_ARM64) || IS_ENABLED(CONFIG_RISCV)) &&
+ IS_ENABLED(CONFIG_ACPI) && !of_root)
+ kunit_skip(test, "arm64/riscv+acpi doesn't populate a root node");
}
EXPORT_SYMBOL_GPL(of_root_kunit_skip);
--
2.45.2
On Thu, 23 Oct 2025 09:04:14 -0700, Guenter Roeck wrote:
> Starting with commit 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by
> probing DT devices when ACPI is used"), riscv images no longer populate
> devicetree if ACPI is enabled. This causes unit tests to fail which require
> the root node to be set.
>
> # Subtest: of_dtb
> # module: of_test
> 1..2
> # of_dtb_root_node_found_by_path: EXPECTATION FAILED at drivers/of/of_test.c:21
> Expected np is not null, but is
> # of_dtb_root_node_found_by_path: pass:0 fail:1 skip:0 total:1
> not ok 1 of_dtb_root_node_found_by_path
> # of_dtb_root_node_populates_of_root: EXPECTATION FAILED at drivers/of/of_test.c:31
> Expected of_root is not null, but is
> # of_dtb_root_node_populates_of_root: pass:0 fail:1 skip:0 total:1
> not ok 2 of_dtb_root_node_populates_of_root
>
> Skip those tests for RISCV if the root node is not populated.
>
> Fixes: 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by probing DT devices when ACPI is used")
> Cc: Han Gao <rabenda.cn@gmail.com>
> Cc: Paul Walmsley <pjw@kernel.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/of/of_kunit_helpers.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
I guess the riscv folks don't care about supporting the relevant
features either, so I've applied it. Can kicked down the road again.
Hi Rob, On Wed, 12 Nov 2025, Rob Herring (Arm) wrote: > I guess the riscv folks don't care about supporting the relevant > features either, so I've applied it. Can kicked down the road again. For the record: we do care. However, it looks like this problem needs a more general solution, something that applies across CPU architectures. Lacking that, we might as well have behavior consistent with ARM64 - and for its faults, this approach is at least simpler to reason about. (That's not to say that I don't have some personal opinions about this topic. IMHO, we're missing a canonical Linux kernel way of representing device integration data. The kernel would control how the various random device integration data formats are integrated and merged, which should sidestep at least some of the problems that we're facing today. That would also give us a reasonable way to store superset data, such as bus topology information. But as for me personally, as you might recall, I'm afraid I lost my appetite for trying to drive device data improvements during the ARM DT conversion of the late 2000s.) Sorry for the delay in getting back to you, and that I don't have the ability to help further at the moment - - Paul
On Thu, Nov 13, 2025 at 8:53 PM Paul Walmsley <pjw@kernel.org> wrote: > > Hi Rob, > > On Wed, 12 Nov 2025, Rob Herring (Arm) wrote: > > > I guess the riscv folks don't care about supporting the relevant > > features either, so I've applied it. Can kicked down the road again. > > For the record: we do care. However, it looks like this problem needs a > more general solution, something that applies across CPU architectures. > Lacking that, we might as well have behavior consistent with ARM64 - and > for its faults, this approach is at least simpler to reason about. The thing is that problems show up on specific machines which has little to do with the specific CPU arch. I don't have any visibility as to what problem you all had which prompted disabling it (for the arch, not the kunit tests) to be able to think about a solution. Leaving it off just means we're potentially adding regressions in the future when we try to turn it on. Rob
On Thu, Nov 20, 2025 at 07:06:46PM -0600, Rob Herring wrote: > On Thu, Nov 13, 2025 at 8:53 PM Paul Walmsley <pjw@kernel.org> wrote: > > > > Hi Rob, > > > > On Wed, 12 Nov 2025, Rob Herring (Arm) wrote: > > > > > I guess the riscv folks don't care about supporting the relevant > > > features either, so I've applied it. Can kicked down the road again. > > > > For the record: we do care. However, it looks like this problem needs a > > more general solution, something that applies across CPU architectures. > > Lacking that, we might as well have behavior consistent with ARM64 - and > > for its faults, this approach is at least simpler to reason about. > > The thing is that problems show up on specific machines which has > little to do with the specific CPU arch. I don't have any visibility > as to what problem you all had which prompted disabling it (for the > arch, not the kunit tests) to be able to think about a solution. > Leaving it off just means we're potentially adding regressions in the > future when we try to turn it on. > Since the patch introducing the problem has now been backported to v6.12 and v6.17, I disabled CONFIG_OF_KUNIT_TEST for riscv entirely in my test system. Guenter
On Thu, 23 Oct 2025, Guenter Roeck wrote:
> Starting with commit 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by
> probing DT devices when ACPI is used"), riscv images no longer populate
> devicetree if ACPI is enabled. This causes unit tests to fail which require
> the root node to be set.
>
> # Subtest: of_dtb
> # module: of_test
> 1..2
> # of_dtb_root_node_found_by_path: EXPECTATION FAILED at drivers/of/of_test.c:21
> Expected np is not null, but is
> # of_dtb_root_node_found_by_path: pass:0 fail:1 skip:0 total:1
> not ok 1 of_dtb_root_node_found_by_path
> # of_dtb_root_node_populates_of_root: EXPECTATION FAILED at drivers/of/of_test.c:31
> Expected of_root is not null, but is
> # of_dtb_root_node_populates_of_root: pass:0 fail:1 skip:0 total:1
> not ok 2 of_dtb_root_node_populates_of_root
>
> Skip those tests for RISCV if the root node is not populated.
>
> Fixes: 69a8b62a7aa1 ("riscv: acpi: avoid errors caused by probing DT devices when ACPI is used")
> Cc: Han Gao <rabenda.cn@gmail.com>
> Cc: Paul Walmsley <pjw@kernel.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Paul Walmsley <pjw@kernel.org> # arch/riscv
thanks Guenter,
- Paul
© 2016 - 2026 Red Hat, Inc.