Re: [PATCH v5 05/11] of: Add a KUnit test for overlays and test managed APIs

2024-06-06 Thread Stephen Boyd
Quoting Rob Herring (2024-06-05 16:47:20) > On Mon, Jun 03, 2024 at 03:38:02PM -0700, Stephen Boyd wrote: > > diff --git a/drivers/of/Makefile b/drivers/of/Makefile > > index 2ae909adde49..abd9c578343b 100644 > > diff --git a/drivers/of/overlay_test.c b/drivers/of/overlay_tes

Re: [PATCH v5 07/11] dt-bindings: test: Add single clk consumer

2024-06-04 Thread Stephen Boyd
Quoting Rob Herring (2024-06-04 13:19:18) > > Yes, but I just added it for you. Oh, we'll probably want to update checkpatch as well to ignore test vendor prefix.

Re: [PATCH v5 07/11] dt-bindings: test: Add single clk consumer

2024-06-04 Thread Stephen Boyd
Quoting Rob Herring (2024-06-04 13:19:18) > On Tue, Jun 4, 2024 at 1:28 PM Stephen Boyd wrote: > > > And replace it with something that makes > > the test vendor prefix opt out of all checking? How is that done? Some > > patch to dtschema directly? > > Ye

Re: [PATCH v5 07/11] dt-bindings: test: Add single clk consumer

2024-06-04 Thread Stephen Boyd
Quoting Rob Herring (2024-06-04 06:05:26) > On Mon, Jun 03, 2024 at 03:38:04PM -0700, Stephen Boyd wrote: > > Describe a binding for a device that consumes a single clk in DT. This > > will initially be used by a KUnit test to clk_get() the clk registered > > by of_fixed

[PATCH v5 11/11] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-06-03 Thread Stephen Boyd
Test that clks registered with 'struct clk_parent_data' work as intended and can find their parents. Cc: Christian Marangi Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- drivers/clk/Kconfig | 1 + drivers/clk/Makefile

[PATCH v5 10/11] dt-bindings: clk: Add clk_parent_data test

2024-06-03 Thread Stephen Boyd
: Rae Moar Signed-off-by: Stephen Boyd --- .../bindings/clock/test,clk-parent-data.yaml | 47 +++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/test,clk-parent-data.yaml diff --git a/Documentation/devicetree/bindings/clock/test,clk

[PATCH v5 09/11] clk: Add KUnit tests for clk fixed rate basic type

2024-06-03 Thread Stephen Boyd
Test that the fixed rate basic type clk works as intended. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- drivers/clk/.kunitconfig | 2 + drivers/clk/Kconfig| 8 + drivers/clk/Makefile | 1

[PATCH v5 08/11] clk: Add test managed clk provider/consumer APIs

2024-06-03 Thread Stephen Boyd
APIs that are used for now. More wrappers can be added in the future as necessary. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- Documentation/dev-tools/kunit/api/clk.rst | 10 + Documentation/dev-tools/kunit/api/index.rst | 5 + drivers/clk/Makefile

[PATCH v5 07/11] dt-bindings: test: Add single clk consumer

2024-06-03 Thread Stephen Boyd
Cc: Rae Moar Signed-off-by: Stephen Boyd --- .../test/test,single-clk-consumer.yaml| 34 +++ 1 file changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/test/test,single-clk-consumer.yaml diff --git a/Documentation/devicetree/bindings/test

[PATCH v5 06/11] platform: Add test managed platform_device/driver APIs

2024-06-03 Thread Stephen Boyd
setup code simpler when a platform driver or platform device is needed. Add a few test cases at the same time to make sure the APIs work as intended. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Stephen Boyd --- Documen

[PATCH v5 05/11] of: Add a KUnit test for overlays and test managed APIs

2024-06-03 Thread Stephen Boyd
into the kernel image. Cc: Rob Herring Cc: Saravana Kannan Cc: Daniel Latypov Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Reviewed-by: Rob Herring (Arm) Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig| 1 + drivers/of/Kconfig | 10 +++ drivers/of/Makefile

[PATCH v5 04/11] dt-bindings: test: Add KUnit empty node binding

2024-06-03 Thread Stephen Boyd
Describe a binding for an empty device node used by KUnit tests to confirm overlays load properly. Reviewed-by: Rob Herring Reviewed-by: David Gow Reviewed-by: Brendan Higgins Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen

[PATCH v5 03/11] dt-bindings: vendor-prefixes: Add "test" vendor for KUnit and friends

2024-06-03 Thread Stephen Boyd
nor Dooley Signed-off-by: Stephen Boyd --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index fbf47f0bacf1..02a22c272

[PATCH v5 02/11] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-06-03 Thread Stephen Boyd
: Rob Herring Cc: Saravana Kannan Reviewed-by: Rob Herring (Arm) Signed-off-by: Stephen Boyd --- Documentation/dev-tools/kunit/api/index.rst | 11 ++ Documentation/dev-tools/kunit/api/of.rst| 13 +++ drivers/of/Makefile | 1 + drivers/of/of_kunit_helpers.c

[PATCH v5 01/11] of/platform: Allow overlays to create platform devices from the root node

2024-06-03 Thread Stephen Boyd
created as children of the root node via DT overlays even if the platform bus wasn't populated for the root node. Cc: Rob Herring Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/of/platform.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH v5 00/11] clk: Add kunit tests for fixed rate and parent data

2024-06-03 Thread Stephen Boyd
; postfix [1] https://lore.kernel.org/r/20230317053415.2254616-1-frowand.l...@gmail.com [2] https://lore.kernel.org/r/20240308195737.ga1174908-r...@kernel.org Stephen Boyd (11): of/platform: Allow overlays to create platform devices from the root node of: Add test managed wrappers for of_overlay

Re: [PATCH v4 06/10] dt-bindings: kunit: Add fixed rate clk consumer test

2024-06-03 Thread Stephen Boyd
Quoting Stephen Boyd (2024-04-22 16:23:59) > diff --git a/Documentation/devicetree/bindings/test/test,clk-fixed-rate.yaml > b/Documentation/devicetree/bindings/test/test,clk-fixed-rate.yaml > new file mode 100644 > index ..b9f58cba944c > --- /dev/null > +++ b/Docume

Re: [PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-05-16 Thread Stephen Boyd
Quoting Rob Herring (2024-05-15 15:08:47) > On Wed, May 15, 2024 at 4:15 PM Stephen Boyd wrote: > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c > > index 389d4ea6bfc1..acecefcfdba7 100644 > > --- a/drivers/of/platform.c > > +++ b/drivers/of/platform.c

Re: [PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-05-15 Thread Stephen Boyd
Quoting Rob Herring (2024-05-15 06:06:09) > On Tue, May 14, 2024 at 4:29 PM Stephen Boyd wrote: > > > > powerpc doesn't mark the root node with OF_POPULATED_BUS. If I set that > > in of_platform_default_populate_init() then the overlays can be applied. > > > > -

Re: [PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-05-14 Thread Stephen Boyd
Quoting Stephen Boyd (2024-05-02 18:27:42) > Quoting David Gow (2024-05-01 01:08:11) > > > > The other thing I've noted so far is that the > > of_apply_kunit_platform_device and of_overlay_apply_kunit_cleanup > > tests fail (and BUG() with a NULL pointer)

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-13 Thread Stephen Boyd
Quoting Stephen Boyd (2024-04-22 16:23:58) > diff --git a/drivers/base/test/platform_kunit.c > b/drivers/base/test/platform_kunit.c > new file mode 100644 > index ..54af6db2a6d8 > --- /dev/null > +++ b/drivers/base/test/platform_kunit.c > @@ -0,0 +1,1

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-10 Thread Stephen Boyd
Quoting David Gow (2024-05-04 01:30:34) > On Fri, 3 May 2024 at 09:04, Stephen Boyd wrote: > > > > Quoting David Gow (2024-05-01 00:55:46) > > > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > > > diff --git a/Documentation/dev-tools/kunit/api/platfor

Re: [PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-05-02 Thread Stephen Boyd
Quoting David Gow (2024-05-01 01:08:11) > > Thanks very much. I'm about halfway through reviewing these, and I > like them a lot so far. > > Most of my thoughts are just naming ideas. I fear some of them may be > the reverse of previous suggestions, as we've since landed the KUnit > device

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-02 Thread Stephen Boyd
Quoting David Gow (2024-05-01 00:55:46) > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > diff --git a/Documentation/dev-tools/kunit/api/platformdevice.rst > > b/Documentation/dev-tools/kunit/api/platformdevice.rst > > new file mode 100644 > > index

Re: [PATCH v4 01/10] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-05-02 Thread Stephen Boyd
Quoting David Gow (2024-05-01 00:55:10) > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > diff --git a/Documentation/dev-tools/kunit/api/index.rst > > b/Documentation/dev-tools/kunit/api/index.rst > > index 2d8f756aab56..282befa17edf 100644 > > --- a/Docume

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-04-30 Thread Stephen Boyd
Quoting Stephen Boyd (2024-04-24 11:11:21) > Quoting Stephen Boyd (2024-04-22 16:23:58) > > diff --git a/drivers/base/test/platform_kunit.c > > b/drivers/base/test/platform_kunit.c [...] > > + > > + /* > > +* Wait for the driver to probe (or at lea

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-04-24 Thread Stephen Boyd
Quoting Stephen Boyd (2024-04-22 16:23:58) > diff --git a/drivers/base/test/platform_kunit.c > b/drivers/base/test/platform_kunit.c > new file mode 100644 > index ..54af6db2a6d8 > --- /dev/null > +++ b/drivers/base/test/platform_kunit.c > @@ -0,0 +1,174

[PATCH v4 10/10] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-04-22 Thread Stephen Boyd
Test that clks registered with 'struct clk_parent_data' work as intended and can find their parents. Cc: Christian Marangi Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- drivers/clk/Kconfig | 1 + drivers/clk/Makefile

[PATCH v4 09/10] dt-bindings: clk: Add KUnit clk_parent_data test

2024-04-22 Thread Stephen Boyd
Moar Signed-off-by: Stephen Boyd --- .../bindings/clock/test,clk-parent-data.yaml | 47 +++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/test,clk-parent-data.yaml diff --git a/Documentation/devicetree/bindings/clock/test,clk-parent

[PATCH v4 08/10] clk: Add KUnit tests for clk fixed rate basic type

2024-04-22 Thread Stephen Boyd
Test that the fixed rate basic type clk works as intended. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- drivers/clk/.kunitconfig | 2 + drivers/clk/Kconfig| 8 + drivers/clk/Makefile | 1

[PATCH v4 07/10] clk: Add test managed clk provider/consumer APIs

2024-04-22 Thread Stephen Boyd
APIs that are used for now. More wrappers can be added in the future as necessary. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- Documentation/dev-tools/kunit/api/clk.rst | 10 + Documentation/dev-tools/kunit/api/index.rst | 5 + drivers/clk/Makefile

[PATCH v4 06/10] dt-bindings: kunit: Add fixed rate clk consumer test

2024-04-22 Thread Stephen Boyd
Signed-off-by: Stephen Boyd --- .../bindings/test/test,clk-fixed-rate.yaml| 35 +++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/test/test,clk-fixed-rate.yaml diff --git a/Documentation/devicetree/bindings/test/test,clk-fixed-rate.yaml

[PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-04-22 Thread Stephen Boyd
setup code simpler when a platform driver or platform device is needed. Add a few test cases at the same time to make sure the APIs work as intended. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Stephen Boyd --- Documen

[PATCH v4 04/10] of: Add a KUnit test for overlays and test managed APIs

2024-04-22 Thread Stephen Boyd
into the kernel image. Cc: Rob Herring Cc: Saravana Kannan Cc: Daniel Latypov Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig| 1 + drivers/of/Kconfig | 10 +++ drivers/of/Makefile| 1 + drivers

[PATCH v4 03/10] dt-bindings: test: Add KUnit empty node binding

2024-04-22 Thread Stephen Boyd
Describe a binding for an empty device node used by KUnit tests to confirm overlays load properly. Reviewed-by: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Signed-off-by: Stephen Boyd --- .../devicetree/bindings/test/test,empty.yaml

[PATCH v4 02/10] dt-bindings: vendor-prefixes: Add "test" vendor for KUnit and friends

2024-04-22 Thread Stephen Boyd
Add the vendor prefix "test" to reserve a vendor prefix for bindings that are purely for testing device tree code. This allows test code to write bindings that can be checked by the schema validator. Reviewed-by: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Signed-off-by: St

[PATCH v4 01/10] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-04-22 Thread Stephen Boyd
: Rob Herring Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- Documentation/dev-tools/kunit/api/index.rst | 11 +++ Documentation/dev-tools/kunit/api/of.rst| 13 +++ drivers/of/Makefile | 1 + drivers/of/of_kunit.c | 99

[PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-04-22 Thread Stephen Boyd
://lore.kernel.org/r/20230317053415.2254616-1-frowand.l...@gmail.com [2] https://lore.kernel.org/r/20240308195737.ga1174908-r...@kernel.org Stephen Boyd (10): of: Add test managed wrappers for of_overlay_apply()/of_node_put() dt-bindings: vendor-prefixes: Add "test" vendor for KUnit and friends

[PATCH v4 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-16 Thread Stephen Boyd
populate some sort of root node. Cc: Rob Herring Cc: Frank Rowand Reviewed-by: David Gow Cc: Brendan Higgins Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig | 3 +++ drivers/of/Kconfig | 9 +++ drivers/of/Makefile | 2 ++ drivers/of/of_test.c| 57

[PATCH v4 5/7] arm64: Unconditionally call unflatten_device_tree()

2024-02-16 Thread Stephen Boyd
Rutland Cc: Signed-off-by: Stephen Boyd --- arch/arm64/kernel/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 42c690bb2d60..0d210720d47d 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c

[PATCH v4 6/7] of: unittest: treat missing of_root as error instead of fixing up

2024-02-16 Thread Stephen Boyd
the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.l...@gmail.com Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/of/unittest.c

[PATCH v4 4/7] x86/of: Unconditionally call unflatten_and_copy_device_tree()

2024-02-16 Thread Stephen Boyd
() returns early. Cc: Rob Herring Cc: Frank Rowand Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Cc: "H. Peter Anvin" Tested-by: Saurabh Sengar Signed-off-by: Stephen Boyd --- arch/x86/kernel/devicetree.c | 24 +--- 1 file c

[PATCH v4 3/7] um: Unconditionally call unflatten_device_tree()

2024-02-16 Thread Stephen Boyd
: Rob Herring Cc: Frank Rowand Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Signed-off-by: Stephen Boyd --- arch/um/kernel/dtb.c | 14 +++--- drivers/of/unittest.c | 4 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/um/kernel/dtb.c b/arch

[PATCH v4 2/7] of: Create of_root if no dtb provided by firmware

2024-02-16 Thread Stephen Boyd
: Update of_have_populated_dt() to treat this empty dtb as not populated. Drop setup_of() initcall] Signed-off-by: Stephen Boyd --- drivers/of/Kconfig| 5 ++--- drivers/of/Makefile | 2 +- drivers/of/empty_root.dts | 6 ++ drivers/of/fdt.c | 32

[PATCH v4 0/7] of: populate of_root node if bootloader doesn't

2024-02-16 Thread Stephen Boyd
if no dtb provided by firmware of: unittest: treat missing of_root as error instead of fixing up Stephen Boyd (5): of: Always unflatten in unflatten_and_copy_device_tree() um: Unconditionally call unflatten_device_tree() x86/of: Unconditionally call unflatten_and_copy_device_tree() arm64

[PATCH v4 1/7] of: Always unflatten in unflatten_and_copy_device_tree()

2024-02-16 Thread Stephen Boyd
and then unflatten it. If there isn't a DT to copy, then the call to unflatten_device_tree() is largely a no-op, so nothing really changes here. Cc: Rob Herring Cc: Frank Rowand Signed-off-by: Stephen Boyd --- drivers/of/fdt.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions

Re: [PATCH v3 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-15 Thread Stephen Boyd
Quoting Rob Herring (2024-02-13 09:52:00) > On Fri, Feb 9, 2024 at 8:59 PM Stephen Boyd wrote: > > > > ---8<--- > > diff --git a/init/main.c b/init/main.c > > index e24b0780fdff..02f5cf8be6c1 100644 > > --- a/init/main.c > > +++ b/init/main.c > >

Re: [PATCH v3 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-09 Thread Stephen Boyd
Quoting Geert Uytterhoeven (2024-02-05 11:55:29) > On Mon, Feb 5, 2024 at 8:19 PM Stephen Boyd wrote: > > Quoting David Gow (2024-02-02 20:10:17) > > > On Sat, 3 Feb 2024 at 03:59, Stephen Boyd wrote: > > > > Add a KUnit test that confirms a DTB has been loaded, i.e

Re: [PATCH v3 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-05 Thread Stephen Boyd
Quoting David Gow (2024-02-02 20:10:17) > On Sat, 3 Feb 2024 at 03:59, Stephen Boyd wrote: > > > > Add a KUnit test that confirms a DTB has been loaded, i.e. there is a > > root node, and that the of_have_populated_dt() API works properly. > > > > Cc: Rob Herr

[PATCH v3 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-02 Thread Stephen Boyd
Add a KUnit test that confirms a DTB has been loaded, i.e. there is a root node, and that the of_have_populated_dt() API works properly. Cc: Rob Herring Cc: Frank Rowand Cc: David Gow Cc: Brendan Higgins Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig | 3 +++ drivers/of/Kconfig

[PATCH v3 6/7] of: unittest: treat missing of_root as error instead of fixing up

2024-02-02 Thread Stephen Boyd
the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.l...@gmail.com Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/of/unittest.c

[PATCH v3 5/7] arm64: Unconditionally call unflatten_device_tree()

2024-02-02 Thread Stephen Boyd
Rutland Cc: Signed-off-by: Stephen Boyd --- arch/arm64/kernel/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 417a8a86b2db..ede3d59dabf0 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c

[PATCH v3 4/7] x86/of: Unconditionally call unflatten_and_copy_device_tree()

2024-02-02 Thread Stephen Boyd
() returns early. Cc: Rob Herring Cc: Frank Rowand Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Cc: "H. Peter Anvin" Cc: Saurabh Sengar Signed-off-by: Stephen Boyd --- arch/x86/kernel/devicetree.c | 24 +--- 1 file changed, 13

[PATCH v3 3/7] um: Unconditionally call unflatten_device_tree()

2024-02-02 Thread Stephen Boyd
: Rob Herring Cc: Frank Rowand Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Signed-off-by: Stephen Boyd --- arch/um/kernel/dtb.c | 14 +++--- drivers/of/unittest.c | 4 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/um/kernel/dtb.c b/arch

[PATCH v3 2/7] of: Create of_root if no dtb provided by firmware

2024-02-02 Thread Stephen Boyd
...@kernel.org: Update of_have_populated_dt() to treat this empty dtb as not populated. Drop setup_of() initcall] Signed-off-by: Stephen Boyd --- drivers/of/Kconfig| 2 +- drivers/of/Makefile | 2 +- drivers/of/empty_root.dts | 6 ++ drivers/of/fdt.c | 32

[PATCH v3 1/7] of: Always unflatten in unflatten_and_copy_device_tree()

2024-02-02 Thread Stephen Boyd
and then unflatten it. If there isn't a DT to copy, then the call to unflatten_device_tree() is largely a no-op, so nothing really changes here. Cc: Rob Herring Cc: Frank Rowand Signed-off-by: Stephen Boyd --- drivers/of/fdt.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions

[PATCH v3 0/7] of: populate of_root node if bootloader doesn't

2024-02-02 Thread Stephen Boyd
of_root if no dtb provided by firmware of: unittest: treat missing of_root as error instead of fixing up Stephen Boyd (5): of: Always unflatten in unflatten_and_copy_device_tree() um: Unconditionally call unflatten_device_tree() x86/of: Unconditionally call unflatten_and_copy_device_tree

Re: [PATCH v2 1/7] arm64: Unconditionally call unflatten_device_tree()

2024-01-31 Thread Stephen Boyd
Quoting Rob Herring (2024-01-31 12:54:05) > On Mon, Jan 29, 2024 at 04:45:00PM -0800, Stephen Boyd wrote: > > Call this function unconditionally so that we can populate an empty DTB > > on platforms that don't boot with a firmware provided or builtin DTB. > > Override 'initial

[PATCH v2 7/7] of: Add KUnit test to confirm DTB is loaded

2024-01-29 Thread Stephen Boyd
Add a KUnit test that confirms a DTB has been loaded, i.e. there is a root node, and that the of_have_populated_dt() API works properly. Cc: Rob Herring Cc: Frank Rowand Cc: David Gow Cc: Brendan Higgins Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig | 3 +++ drivers/of/Kconfig

[PATCH v2 6/7] of: unittest: treat missing of_root as error instead of fixing up

2024-01-29 Thread Stephen Boyd
the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.l...@gmail.com Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/of/unittest.c

[PATCH v2 5/7] of: Create of_root if no dtb provided by firmware

2024-01-29 Thread Stephen Boyd
...@kernel.org: Update of_have_populated_dt() to treat this empty dtb as not populated. Drop setup_of() initcall] Signed-off-by: Stephen Boyd --- drivers/of/Kconfig| 2 +- drivers/of/Makefile | 2 +- drivers/of/empty_root.dts | 6 ++ drivers/of/fdt.c | 20

[PATCH v2 4/7] of: Always unflatten in unflatten_and_copy_device_tree()

2024-01-29 Thread Stephen Boyd
and then unflatten it. If there isn't a DT to copy, then the call to unflatten_device_tree() is largely a no-op, so nothing really changes here. Cc: Rob Herring Cc: Frank Rowand Signed-off-by: Stephen Boyd --- drivers/of/fdt.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions

[PATCH v2 3/7] x86/of: Unconditionally call unflatten_and_copy_device_tree()

2024-01-29 Thread Stephen Boyd
c: Saurabh Sengar Signed-off-by: Stephen Boyd --- arch/x86/kernel/devicetree.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index afd09924094e..650752d112a6 100644 --- a/arch/x86/kernel/de

[PATCH v2 2/7] um: Unconditionally call unflatten_device_tree()

2024-01-29 Thread Stephen Boyd
: Rob Herring Cc: Frank Rowand Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Signed-off-by: Stephen Boyd --- arch/um/kernel/dtb.c | 14 +++--- drivers/of/unittest.c | 4 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/um/kernel/dtb.c b/arch

[PATCH v2 1/7] arm64: Unconditionally call unflatten_device_tree()

2024-01-29 Thread Stephen Boyd
boot. If there isn't a valid initial_boot_params dtb then unflatten_device_tree() returns early so this is fine. Cc: Rob Herring Cc: Frank Rowand Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Signed-off-by: Stephen Boyd --- arch/arm64/kernel/setup.c | 7 +-- 1 file changed, 5

[PATCH v2 0/7] of: populate of_root node if bootloader doesn't

2024-01-29 Thread Stephen Boyd
Kconfig hidden but def_bool enabled otherwise Frank Rowand (2): of: Create of_root if no dtb provided by firmware of: unittest: treat missing of_root as error instead of fixing up Stephen Boyd (5): arm64: Unconditionally call unflatten_device_tree() um: Unconditionally call

Re: [PATCH 6/6] of: Add KUnit test to confirm DTB is loaded

2024-01-22 Thread Stephen Boyd
Quoting David Gow (2024-01-15 21:03:12) > On Sat, 13 Jan 2024 at 04:07, Stephen Boyd wrote: > > > > Add a KUnit test that confirms a DTB has been loaded, i.e. there is a > > root node, and that the of_have_populated_dt() API works properly. > > > > Cc: Rob Herr

Re: [PATCH 1/6] arm64: Unconditionally call unflatten_device_tree()

2024-01-17 Thread Stephen Boyd
Quoting Rob Herring (2024-01-17 09:54:48) > On Tue, Jan 16, 2024 at 05:27:18PM -0800, Stephen Boyd wrote: > > Quoting Mark Rutland (2024-01-16 03:51:14) > > > Hi Stephen, > > > > > > On Fri, Jan 12, 2024 at 12:07:44PM -0800, Stephen Boyd wrote: > >

Re: [PATCH 1/6] arm64: Unconditionally call unflatten_device_tree()

2024-01-16 Thread Stephen Boyd
Quoting Mark Rutland (2024-01-16 03:51:14) > Hi Stephen, > > On Fri, Jan 12, 2024 at 12:07:44PM -0800, Stephen Boyd wrote: > > Call this function unconditionally so that we can populate an empty DTB > > on platforms that don't boot with a firmware provided or builtin DTB

Re: [PATCH 4/6] of: Create of_root if no dtb provided by firmware

2024-01-16 Thread Stephen Boyd
Quoting Rob Herring (2024-01-15 12:32:30) > On Fri, Jan 12, 2024 at 12:07:47PM -0800, Stephen Boyd wrote: > > diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig > > index da9826accb1b..9628e48baa15 100644 > > --- a/drivers/of/Kconfig > > +++ b/drivers/of/Kconfig &g

[PATCH 6/6] of: Add KUnit test to confirm DTB is loaded

2024-01-12 Thread Stephen Boyd
Add a KUnit test that confirms a DTB has been loaded, i.e. there is a root node, and that the of_have_populated_dt() API works properly. Cc: Rob Herring Cc: Frank Rowand Cc: David Gow Cc: Brendan Higgins Signed-off-by: Stephen Boyd --- drivers/of/.kunitconfig | 3 ++ drivers/of/Kconfig

[PATCH 5/6] of: unittest: treat missing of_root as error instead of fixing up

2024-01-12 Thread Stephen Boyd
the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.l...@gmail.com Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/of/unittest.c

[PATCH 4/6] of: Create of_root if no dtb provided by firmware

2024-01-12 Thread Stephen Boyd
...@kernel.org: Update of_have_populated_dt() to treat this empty dtb as not populated. Drop setup_of() initcall] Signed-off-by: Stephen Boyd --- drivers/of/Kconfig| 7 ++- drivers/of/Makefile | 2 +- drivers/of/empty_root.dts | 6 ++ drivers/of/fdt.c | 25

[PATCH 3/6] of: Always unflatten in unflatten_and_copy_device_tree()

2024-01-12 Thread Stephen Boyd
and then unflatten it. If there isn't a DT to copy, then the call to unflatten_device_tree() is largely a no-op, so nothing really changes here. Cc: Rob Herring Cc: Frank Rowand Signed-off-by: Stephen Boyd --- drivers/of/fdt.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions

[PATCH 2/6] um: Unconditionally call unflatten_device_tree()

2024-01-12 Thread Stephen Boyd
: Rob Herring Cc: Frank Rowand Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Signed-off-by: Stephen Boyd --- arch/um/kernel/dtb.c | 14 +++--- drivers/of/unittest.c | 4 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/um/kernel/dtb.c b/arch

[PATCH 1/6] arm64: Unconditionally call unflatten_device_tree()

2024-01-12 Thread Stephen Boyd
early. Cc: Rob Herring Cc: Frank Rowand Cc: Catalin Marinas Cc: Will Deacon Cc: Signed-off-by: Stephen Boyd --- arch/arm64/kernel/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 417a8a86b2db..ede3d59dabf0

[PATCH 0/6] of: populate of_root node if bootloader doesn't

2024-01-12 Thread Stephen Boyd
false if the DTB isn't from the bootloader * Architecture calls made unconditional so that a root node is always made Frank Rowand (2): of: Create of_root if no dtb provided by firmware of: unittest: treat missing of_root as error instead of fixing up Stephen Boyd (4): arm64