devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] of: unittest: unflatten device tree on UML when testing
@ 2019-02-16  0:46 Brendan Higgins
  2019-02-16  2:18 ` Frank Rowand
  0 siblings, 1 reply; 4+ messages in thread
From: Brendan Higgins @ 2019-02-16  0:46 UTC (permalink / raw)
  To: robh+dt, frowand.list, mcgrof; +Cc: devicetree, linux-kernel, Brendan Higgins

UML supports enabling OF, and is useful for running the device tree
tests, so add support for unflattening device tree blobs so we can
actually use it.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
---
 drivers/of/unittest.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 84427384654d5..6de34d5fa0e85 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2527,6 +2527,9 @@ static int __init of_unittest(void)
 	}
 	of_node_put(np);
 
+	if (IS_ENABLED(CONFIG_UML))
+		unittest_unflatten_overlay_base();
+
 	pr_info("start of unittest - you will see error messages\n");
 	of_unittest_check_tree_linkage();
 	of_unittest_check_phandles();
-- 
2.21.0.rc0.258.g878e2cd30e-goog

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

* Re: [PATCH v2] of: unittest: unflatten device tree on UML when testing
  2019-02-16  0:46 [PATCH v2] of: unittest: unflatten device tree on UML when testing Brendan Higgins
@ 2019-02-16  2:18 ` Frank Rowand
  2019-02-16  2:35   ` Frank Rowand
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Rowand @ 2019-02-16  2:18 UTC (permalink / raw)
  To: Brendan Higgins, robh+dt, mcgrof; +Cc: devicetree, linux-kernel

On 2/15/19 4:46 PM, Brendan Higgins wrote:
> UML supports enabling OF, and is useful for running the device tree
> tests, so add support for unflattening device tree blobs so we can
> actually use it.
> 
> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> ---
>  drivers/of/unittest.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 84427384654d5..6de34d5fa0e85 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -2527,6 +2527,9 @@ static int __init of_unittest(void)
>  	}
>  	of_node_put(np);
>  
> +	if (IS_ENABLED(CONFIG_UML))
> +		unittest_unflatten_overlay_base();
> +

This is still the wrong location.  It should be at the top of the function.

I'll try moving it to the top and see if it still works -- should only
take me a few minutes.

-Frank

>  	pr_info("start of unittest - you will see error messages\n");
>  	of_unittest_check_tree_linkage();
>  	of_unittest_check_phandles();
> 

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

* Re: [PATCH v2] of: unittest: unflatten device tree on UML when testing
  2019-02-16  2:18 ` Frank Rowand
@ 2019-02-16  2:35   ` Frank Rowand
  2019-02-19 23:38     ` Brendan Higgins
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Rowand @ 2019-02-16  2:35 UTC (permalink / raw)
  To: Brendan Higgins, robh+dt, mcgrof; +Cc: devicetree, linux-kernel

On 2/15/19 6:18 PM, Frank Rowand wrote:
> On 2/15/19 4:46 PM, Brendan Higgins wrote:
>> UML supports enabling OF, and is useful for running the device tree
>> tests, so add support for unflattening device tree blobs so we can
>> actually use it.
>>
>> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
>> ---
>>  drivers/of/unittest.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
>> index 84427384654d5..6de34d5fa0e85 100644
>> --- a/drivers/of/unittest.c
>> +++ b/drivers/of/unittest.c
>> @@ -2527,6 +2527,9 @@ static int __init of_unittest(void)
>>  	}
>>  	of_node_put(np);
>>  
>> +	if (IS_ENABLED(CONFIG_UML))
>> +		unittest_unflatten_overlay_base();
>> +
> 
> This is still the wrong location.  It should be at the top of the function.
> 
> I'll try moving it to the top and see if it still works -- should only
> take me a few minutes.

Yep, see below.


> -Frank
> 
>>  	pr_info("start of unittest - you will see error messages\n");
>>  	of_unittest_check_tree_linkage();
>>  	of_unittest_check_phandles();
>>
> 
> 

This is probably white space damaged because I used cut and paste,
but this is what I meant above.

Tested on 5.0-rc3.

Applied patches 1-14 of series:

   [RFC v4 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework

booted uml, saw the expected 219 pass, 1 fail.

Applied the following patch, saw the expected 224 pass, 0 fail.

I did not apply patch 15 of the other series, but applying patch 15
should still result in errors on boot, as I reported in the mail
thread for that patch series.

---
 drivers/of/unittest.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: b/drivers/of/unittest.c
===================================================================
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2514,6 +2514,10 @@ static int __init of_unittest(void)
 	int res;
 
 	/* adding data for unittest */
+
+	if (IS_ENABLED(CONFIG_UML))
+		unittest_unflatten_overlay_base();
+
 	res = unittest_data_add();
 	if (res)
 		return res;

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

* Re: [PATCH v2] of: unittest: unflatten device tree on UML when testing
  2019-02-16  2:35   ` Frank Rowand
@ 2019-02-19 23:38     ` Brendan Higgins
  0 siblings, 0 replies; 4+ messages in thread
From: Brendan Higgins @ 2019-02-19 23:38 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Rob Herring, Luis Chamberlain, devicetree,
	Linux Kernel Mailing List

On Fri, Feb 15, 2019 at 6:35 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 2/15/19 6:18 PM, Frank Rowand wrote:
> > On 2/15/19 4:46 PM, Brendan Higgins wrote:
> >> UML supports enabling OF, and is useful for running the device tree
> >> tests, so add support for unflattening device tree blobs so we can
> >> actually use it.
> >>
> >> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> >> ---
> >>  drivers/of/unittest.c | 3 +++
> >>  1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> >> index 84427384654d5..6de34d5fa0e85 100644
> >> --- a/drivers/of/unittest.c
> >> +++ b/drivers/of/unittest.c
> >> @@ -2527,6 +2527,9 @@ static int __init of_unittest(void)
> >>      }
> >>      of_node_put(np);
> >>
> >> +    if (IS_ENABLED(CONFIG_UML))
> >> +            unittest_unflatten_overlay_base();
> >> +
> >
> > This is still the wrong location.  It should be at the top of the function.

Oh sorry, I figured since this only sets up the overlay_base that the
dependency order didn't matter. I will send an updated patch shortly.

> >
> > I'll try moving it to the top and see if it still works -- should only
> > take me a few minutes.
>
> Yep, see below.
>
>
> > -Frank
> >
> >>      pr_info("start of unittest - you will see error messages\n");
> >>      of_unittest_check_tree_linkage();
> >>      of_unittest_check_phandles();
> >>
> >
> >
>
> This is probably white space damaged because I used cut and paste,
> but this is what I meant above.
>
> Tested on 5.0-rc3.
>
> Applied patches 1-14 of series:
>
>    [RFC v4 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework
>
> booted uml, saw the expected 219 pass, 1 fail.
>
> Applied the following patch, saw the expected 224 pass, 0 fail.
>
> I did not apply patch 15 of the other series, but applying patch 15
> should still result in errors on boot, as I reported in the mail
> thread for that patch series.

Sure, I will address that there.

Thanks!

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

end of thread, other threads:[~2019-02-19 23:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-16  0:46 [PATCH v2] of: unittest: unflatten device tree on UML when testing Brendan Higgins
2019-02-16  2:18 ` Frank Rowand
2019-02-16  2:35   ` Frank Rowand
2019-02-19 23:38     ` Brendan Higgins

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).