devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
@ 2025-10-23 16:04 Guenter Roeck
  2025-10-23 16:48 ` Paul Walmsley
  2025-11-12 19:58 ` Rob Herring (Arm)
  0 siblings, 2 replies; 9+ messages in thread
From: Guenter Roeck @ 2025-10-23 16:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: Saravana Kannan, devicetree, linux-kernel, linux-riscv,
	Guenter Roeck, Han Gao, Paul Walmsley

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-23 16:04 [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node Guenter Roeck
@ 2025-10-23 16:48 ` Paul Walmsley
  2025-10-24  1:00   ` Rob Herring
  2025-11-12 19:58 ` Rob Herring (Arm)
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Walmsley @ 2025-10-23 16:48 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Rob Herring, Saravana Kannan, devicetree, linux-kernel,
	linux-riscv, Han Gao, Paul Walmsley

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-23 16:48 ` Paul Walmsley
@ 2025-10-24  1:00   ` Rob Herring
  2025-10-24  2:54     ` Paul Walmsley
  2025-10-24  3:45     ` Guenter Roeck
  0 siblings, 2 replies; 9+ messages in thread
From: Rob Herring @ 2025-10-24  1:00 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Guenter Roeck, Saravana Kannan, devicetree, linux-kernel,
	linux-riscv, Han Gao

On Thu, Oct 23, 2025 at 11:48 AM Paul Walmsley <pjw@kernel.org> wrote:
>
> 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

FWIW, the fixed commit will also prevent enabling features like this
series[1] enables. Arm64 is still disabled ATM because of disagreement
with the arm64 maintainers, so that can was kicked down the road. It
would be better to not disable this and address the issues as they
happen rather than breaking people down the road.

Rob

[1] https://lore.kernel.org/all/20251015071420.1173068-1-herve.codina@bootlin.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-24  1:00   ` Rob Herring
@ 2025-10-24  2:54     ` Paul Walmsley
  2025-10-24 12:02       ` Rob Herring
  2025-10-24  3:45     ` Guenter Roeck
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Walmsley @ 2025-10-24  2:54 UTC (permalink / raw)
  To: Rob Herring
  Cc: Paul Walmsley, Guenter Roeck, Saravana Kannan, devicetree,
	linux-kernel, linux-riscv, Han Gao

[-- Attachment #1: Type: text/plain, Size: 1881 bytes --]

On Thu, 23 Oct 2025, Rob Herring wrote:

> On Thu, Oct 23, 2025 at 11:48 AM Paul Walmsley <pjw@kernel.org> wrote:
> >
> > 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
> 
> FWIW, the fixed commit will also prevent enabling features like this
> series[1] enables. Arm64 is still disabled ATM because of disagreement
> with the arm64 maintainers, so that can was kicked down the road. It
> would be better to not disable this and address the issues as they
> happen rather than breaking people down the road.

Thanks for the context, Rob.  Can you share a pointer to the ARM64 
disagreement thread(s) (either publicly or privately)?  


- Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-24  1:00   ` Rob Herring
  2025-10-24  2:54     ` Paul Walmsley
@ 2025-10-24  3:45     ` Guenter Roeck
  1 sibling, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2025-10-24  3:45 UTC (permalink / raw)
  To: Rob Herring, Paul Walmsley
  Cc: Saravana Kannan, devicetree, linux-kernel, linux-riscv, Han Gao

On 10/23/25 18:00, Rob Herring wrote:
> On Thu, Oct 23, 2025 at 11:48 AM Paul Walmsley <pjw@kernel.org> wrote:
>>
>> 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
> 
> FWIW, the fixed commit will also prevent enabling features like this
> series[1] enables. Arm64 is still disabled ATM because of disagreement
> with the arm64 maintainers, so that can was kicked down the road. It
> would be better to not disable this and address the issues as they
> happen rather than breaking people down the road.
> 

I guess that means that I'll have to disable devicetree unit tests for
riscv targets. NP; thanks for letting me know.

Guenter


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-24  2:54     ` Paul Walmsley
@ 2025-10-24 12:02       ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2025-10-24 12:02 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Guenter Roeck, Saravana Kannan, devicetree, linux-kernel,
	linux-riscv, Han Gao

On Thu, Oct 23, 2025 at 9:54 PM Paul Walmsley <pjw@kernel.org> wrote:
>
> On Thu, 23 Oct 2025, Rob Herring wrote:
>
> > On Thu, Oct 23, 2025 at 11:48 AM Paul Walmsley <pjw@kernel.org> wrote:
> > >
> > > 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
> >
> > FWIW, the fixed commit will also prevent enabling features like this
> > series[1] enables. Arm64 is still disabled ATM because of disagreement
> > with the arm64 maintainers, so that can was kicked down the road. It
> > would be better to not disable this and address the issues as they
> > happen rather than breaking people down the road.
>
> Thanks for the context, Rob.  Can you share a pointer to the ARM64
> disagreement thread(s) (either publicly or privately)?

https://lore.kernel.org/all/ZaZtbU9hre3YhZam@FVFF77S0Q05N/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-10-23 16:04 [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node Guenter Roeck
  2025-10-23 16:48 ` Paul Walmsley
@ 2025-11-12 19:58 ` Rob Herring (Arm)
  2025-11-14  2:53   ` Paul Walmsley
  1 sibling, 1 reply; 9+ messages in thread
From: Rob Herring (Arm) @ 2025-11-12 19:58 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: devicetree, linux-kernel, Han Gao, linux-riscv, Paul Walmsley,
	Saravana Kannan

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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-11-12 19:58 ` Rob Herring (Arm)
@ 2025-11-14  2:53   ` Paul Walmsley
  2025-11-21  1:06     ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Walmsley @ 2025-11-14  2:53 UTC (permalink / raw)
  To: Rob Herring (Arm)
  Cc: Guenter Roeck, devicetree, linux-kernel, Han Gao, linux-riscv,
	Paul Walmsley, Saravana Kannan

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node
  2025-11-14  2:53   ` Paul Walmsley
@ 2025-11-21  1:06     ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2025-11-21  1:06 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Guenter Roeck, devicetree, linux-kernel, Han Gao, linux-riscv

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-11-21  1:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 16:04 [PATCH] of: Skip devicetree kunit tests when RISCV+ACPI doesn't populate root node Guenter Roeck
2025-10-23 16:48 ` Paul Walmsley
2025-10-24  1:00   ` Rob Herring
2025-10-24  2:54     ` Paul Walmsley
2025-10-24 12:02       ` Rob Herring
2025-10-24  3:45     ` Guenter Roeck
2025-11-12 19:58 ` Rob Herring (Arm)
2025-11-14  2:53   ` Paul Walmsley
2025-11-21  1:06     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).