All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
@ 2018-02-19  0:29 frowand.list
  2018-02-19  1:46 ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: frowand.list @ 2018-02-19  0:29 UTC (permalink / raw)
  To: Rob Herring, pantelis.antoniou, Pantelis Antoniou
  Cc: devicetree, linux-kernel, geert

From: Frank Rowand <frank.rowand@sony.com>

kbuild test robot reported a new warning for a recent patch:
>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
     of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);

The cause is that the prototype for of_fdt_unflatten_tree() in
include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.

This was a pre-existing problem for any overlay related caller of
of_fdt_unflatten_device_tree(), who was then going to pass the
unflattened tree to of_overlay_apply().  After the patch that triggered
this warning, all other overlay callers of of_fdt_unflatten_device_tree()
no longer exist, so adding the select to OF_OVERLAY is a sufficient fix.

To reproduce the warning:
  Use the .config attached to https://lkml.org/lkml/2018/2/17/268
  make ARCH=i386 olddefconfig
  make ARCH=i386 CC=gcc-7 drivers/of/overlay.o

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
---
 drivers/of/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 783e0870bd22..00a6abfaaec7 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -92,6 +92,7 @@ config OF_RESOLVE
 config OF_OVERLAY
 	bool "Device Tree overlays"
 	select OF_DYNAMIC
+	select OF_EARLY_FLATTREE
 	select OF_RESOLVE
 	help
 	  Overlays are a method to dynamically modify part of the kernel's
-- 
Frank Rowand <frank.rowand@sony.com>

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

* Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
  2018-02-19  0:29 [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE frowand.list
@ 2018-02-19  1:46 ` Rob Herring
  2018-02-19  6:24   ` Frank Rowand
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2018-02-19  1:46 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Pantelis Antoniou, Pantelis Antoniou, devicetree, linux-kernel,
	Geert Uytterhoeven

On Sun, Feb 18, 2018 at 6:29 PM,  <frowand.list@gmail.com> wrote:
> From: Frank Rowand <frank.rowand@sony.com>
>
> kbuild test robot reported a new warning for a recent patch:
>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
>      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
>
> The cause is that the prototype for of_fdt_unflatten_tree() in
> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.
>
> This was a pre-existing problem for any overlay related caller of
> of_fdt_unflatten_device_tree(), who was then going to pass the
> unflattened tree to of_overlay_apply().  After the patch that triggered
> this warning, all other overlay callers of of_fdt_unflatten_device_tree()
> no longer exist, so adding the select to OF_OVERLAY is a sufficient fix.
>
> To reproduce the warning:
>   Use the .config attached to https://lkml.org/lkml/2018/2/17/268
>   make ARCH=i386 olddefconfig
>   make ARCH=i386 CC=gcc-7 drivers/of/overlay.o
>
> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> ---
>  drivers/of/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> index 783e0870bd22..00a6abfaaec7 100644
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -92,6 +92,7 @@ config OF_RESOLVE
>  config OF_OVERLAY
>         bool "Device Tree overlays"
>         select OF_DYNAMIC
> +       select OF_EARLY_FLATTREE

If we do this, we might as well kill OF_EARLY_FLATTREE. What platform
really boots from not FDT, but uses DT without overlays?

Rob

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

* Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
  2018-02-19  1:46 ` Rob Herring
@ 2018-02-19  6:24   ` Frank Rowand
  2018-02-28 20:26     ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Rowand @ 2018-02-19  6:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Pantelis Antoniou, devicetree, linux-kernel,
	Geert Uytterhoeven

On 02/18/18 17:46, Rob Herring wrote:
> On Sun, Feb 18, 2018 at 6:29 PM,  <frowand.list@gmail.com> wrote:
>> From: Frank Rowand <frank.rowand@sony.com>
>>
>> kbuild test robot reported a new warning for a recent patch:
>>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
>>      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
>>
>> The cause is that the prototype for of_fdt_unflatten_tree() in
>> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.
>>
>> This was a pre-existing problem for any overlay related caller of
>> of_fdt_unflatten_device_tree(), who was then going to pass the
>> unflattened tree to of_overlay_apply().  After the patch that triggered
>> this warning, all other overlay callers of of_fdt_unflatten_device_tree()
>> no longer exist, so adding the select to OF_OVERLAY is a sufficient fix.
>>
>> To reproduce the warning:
>>   Use the .config attached to https://lkml.org/lkml/2018/2/17/268
>>   make ARCH=i386 olddefconfig
>>   make ARCH=i386 CC=gcc-7 drivers/of/overlay.o
>>
>> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
>> ---
>>  drivers/of/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
>> index 783e0870bd22..00a6abfaaec7 100644
>> --- a/drivers/of/Kconfig
>> +++ b/drivers/of/Kconfig
>> @@ -92,6 +92,7 @@ config OF_RESOLVE
>>  config OF_OVERLAY
>>         bool "Device Tree overlays"
>>         select OF_DYNAMIC
>> +       select OF_EARLY_FLATTREE
> 
> If we do this, we might as well kill OF_EARLY_FLATTREE. What platform
> really boots from not FDT, but uses DT without overlays?

Making sure I'm understanding...  So you want to remove OF_EARLY_FLATTREE
and convert the current users of it to OF_FLATTREE?

I don't see any way to directly configure OF_FLATTREE and I don't see any
Kconfig file selecting it, other than drivers/of/Kconfig which selects
OF_FLATTREE from OF_EARLY_FLATTREE.  So as far as I can tell, the two
config options are essentially a single config option.  Meaning that
either one could be replaced by the other.

Changing all to OF_FLATTREE will touch more files and thus will be a
bit more obtrusive.  It looks like it would take two releases to avoid
a flag day change.

Changing all to OF_EARLY_FLATTREE can be done in a single release.

I can create a patch set whichever way you prefer.

-Frank

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

* Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
  2018-02-19  6:24   ` Frank Rowand
@ 2018-02-28 20:26     ` Rob Herring
  2018-02-28 21:44       ` Frank Rowand
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2018-02-28 20:26 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Pantelis Antoniou, Pantelis Antoniou, devicetree, linux-kernel,
	Geert Uytterhoeven

Sorry for the delay, been away for a few days.

On Mon, Feb 19, 2018 at 12:24 AM, Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 02/18/18 17:46, Rob Herring wrote:
> > On Sun, Feb 18, 2018 at 6:29 PM,  <frowand.list@gmail.com> wrote:
> >> From: Frank Rowand <frank.rowand@sony.com>
> >>
> >> kbuild test robot reported a new warning for a recent patch:
> >>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
> >>      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
> >>
> >> The cause is that the prototype for of_fdt_unflatten_tree() in
> >> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.

Umm, this is not true. of_fdt_unflatten_tree is outside the ifdef for
OF_EARLY_FLATTREE.

> >>
> >> This was a pre-existing problem for any overlay related caller of
> >> of_fdt_unflatten_device_tree(), who was then going to pass the
> >> unflattened tree to of_overlay_apply().  After the patch that triggered
> >> this warning, all other overlay callers of of_fdt_unflatten_device_tree()
> >> no longer exist, so adding the select to OF_OVERLAY is a sufficient fix.
> >>
> >> To reproduce the warning:
> >>   Use the .config attached to https://lkml.org/lkml/2018/2/17/268
> >>   make ARCH=i386 olddefconfig
> >>   make ARCH=i386 CC=gcc-7 drivers/of/overlay.o
> >>
> >> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> >> ---
> >>  drivers/of/Kconfig | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> >> index 783e0870bd22..00a6abfaaec7 100644
> >> --- a/drivers/of/Kconfig
> >> +++ b/drivers/of/Kconfig
> >> @@ -92,6 +92,7 @@ config OF_RESOLVE
> >>  config OF_OVERLAY
> >>         bool "Device Tree overlays"
> >>         select OF_DYNAMIC
> >> +       select OF_EARLY_FLATTREE

This should really have been OF_FLATTREE...

> > If we do this, we might as well kill OF_EARLY_FLATTREE. What platform
> > really boots from not FDT, but uses DT without overlays?
>
> Making sure I'm understanding...  So you want to remove OF_EARLY_FLATTREE
> and convert the current users of it to OF_FLATTREE?

Right. OF_EARLY_FLATTREE just controls everything that's in __init
section anyway. So the question is it worth a kconfig option to
control code that's in the __init section and will get discarded
anyway?


> I don't see any way to directly configure OF_FLATTREE and I don't see any
> Kconfig file selecting it, other than drivers/of/Kconfig which selects
> OF_FLATTREE from OF_EARLY_FLATTREE.  So as far as I can tell, the two
> config options are essentially a single config option.  Meaning that
> either one could be replaced by the other.
>
> Changing all to OF_FLATTREE will touch more files and thus will be a
> bit more obtrusive.  It looks like it would take two releases to avoid
> a flag day change.
>
> Changing all to OF_EARLY_FLATTREE can be done in a single release.

I would get rid of OF_EARLY_FLATREE within the DT core code making it
do nothing more than select OF_FLATTREE. Then the arches can later
just select OF_FLATTREE directly.

But this is all orthogonal to your issue. I think we need to keep the
overlay dependencies on FDT separate. In theory we could support
non-FDT sources or some more complex use that needs to unflatten FDT
themselves. I don't really want to add another user visible kconfig
option (OF_FDT_OVERLAY), so I think as long as we structure things to
support that when needed we're fine.

Rob

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

* Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
  2018-02-28 20:26     ` Rob Herring
@ 2018-02-28 21:44       ` Frank Rowand
  2018-03-01 16:14         ` Frank Rowand
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Rowand @ 2018-02-28 21:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Pantelis Antoniou, devicetree, linux-kernel,
	Geert Uytterhoeven

On 02/28/18 12:26, Rob Herring wrote:
> Sorry for the delay, been away for a few days.
> 
> On Mon, Feb 19, 2018 at 12:24 AM, Frank Rowand <frowand.list@gmail.com> wrote:
>>
>> On 02/18/18 17:46, Rob Herring wrote:
>>> On Sun, Feb 18, 2018 at 6:29 PM,  <frowand.list@gmail.com> wrote:
>>>> From: Frank Rowand <frank.rowand@sony.com>
>>>>
>>>> kbuild test robot reported a new warning for a recent patch:
>>>>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
>>>>      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
>>>>
>>>> The cause is that the prototype for of_fdt_unflatten_tree() in
>>>> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.
> 
> Umm, this is not true. of_fdt_unflatten_tree is outside the ifdef for
> OF_EARLY_FLATTREE.

Brown paper bag.  :-(  As you note below, CONFIG_OF_FLATTREE is the
relevant option.


>>>>
>>>> This was a pre-existing problem for any overlay related caller of
>>>> of_fdt_unflatten_device_tree(), who was then going to pass the
>>>> unflattened tree to of_overlay_apply().  After the patch that triggered
>>>> this warning, all other overlay callers of of_fdt_unflatten_device_tree()
>>>> no longer exist, so adding the select to OF_OVERLAY is a sufficient fix.
>>>>
>>>> To reproduce the warning:
>>>>   Use the .config attached to https://lkml.org/lkml/2018/2/17/268
>>>>   make ARCH=i386 olddefconfig
>>>>   make ARCH=i386 CC=gcc-7 drivers/of/overlay.o
>>>>
>>>> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
>>>> ---
>>>>  drivers/of/Kconfig | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
>>>> index 783e0870bd22..00a6abfaaec7 100644
>>>> --- a/drivers/of/Kconfig
>>>> +++ b/drivers/of/Kconfig
>>>> @@ -92,6 +92,7 @@ config OF_RESOLVE
>>>>  config OF_OVERLAY
>>>>         bool "Device Tree overlays"
>>>>         select OF_DYNAMIC
>>>> +       select OF_EARLY_FLATTREE
> 
> This should really have been OF_FLATTREE...

Yes.  This only fixed the warning because OF_EARLY_FLATTREE selects
OF_FLATTREE.


>>> If we do this, we might as well kill OF_EARLY_FLATTREE. What platform
>>> really boots from not FDT, but uses DT without overlays?
>>
>> Making sure I'm understanding...  So you want to remove OF_EARLY_FLATTREE
>> and convert the current users of it to OF_FLATTREE?
> 
> Right. OF_EARLY_FLATTREE just controls everything that's in __init
> section anyway. So the question is it worth a kconfig option to
> control code that's in the __init section and will get discarded
> anyway?
> 
> 
>> I don't see any way to directly configure OF_FLATTREE and I don't see anyk
>> Kconfig file selecting it, other than drivers/of/Kconfig which selects
>> OF_FLATTREE from OF_EARLY_FLATTREE.  So as far as I can tell, the two
>> config options are essentially a single config option.  Meaning that
>> either one could be replaced by the other.
>>
>> Changing all to OF_FLATTREE will touch more files and thus will be a
>> bit more obtrusive.  It looks like it would take two releases to avoid
>> a flag day change.
>>
>> Changing all to OF_EARLY_FLATTREE can be done in a single release.
> 
> I would get rid of OF_EARLY_FLATREE within the DT core code making it
> do nothing more than select OF_FLATTREE. Then the arches can later
> just select OF_FLATTREE directly.

OK, will do.


> But this is all orthogonal to your issue. I think we need to keep the
> overlay dependencies on FDT separate. In theory we could support
> non-FDT sources or some more complex use that needs to unflatten FDT
> themselves. I don't really want to add another user visible kconfig
> option (OF_FDT_OVERLAY), so I think as long as we structure things to
> support that when needed we're fine.

OK, at the "theoretical, what if, keep our options open" level.

I'll add the desire to allow future support of non-FDT sources to
my general overlay requirements as I propose changes.  So far, my
proposed patches isolate the FDT source dependency in a single small
function, so it seems all is OK from that angle.  But all use of overlays 
for many previous releases requires manually selecting OF_FLATTREE, given
that FDTs have been the overlay source.  So it seems to make sense for
OF_OVERLAY to select OF_FLATTREE (not OF_EARLY_FLATTREE as I mistakenly
chose) now.  And if future non-FDT overlays are implemented in the
future, re-visit how to select OF_FLATTREE in a more granular manner.

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

* Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE
  2018-02-28 21:44       ` Frank Rowand
@ 2018-03-01 16:14         ` Frank Rowand
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Rowand @ 2018-03-01 16:14 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pantelis Antoniou, Pantelis Antoniou, devicetree, linux-kernel,
	Geert Uytterhoeven

On 02/28/18 13:44, Frank Rowand wrote:
> On 02/28/18 12:26, Rob Herring wrote:
>> Sorry for the delay, been away for a few days.
>>
>> On Mon, Feb 19, 2018 at 12:24 AM, Frank Rowand <frowand.list@gmail.com> wrote:
>>>
>>> On 02/18/18 17:46, Rob Herring wrote:
>>>> On Sun, Feb 18, 2018 at 6:29 PM,  <frowand.list@gmail.com> wrote:
>>>>> From: Frank Rowand <frank.rowand@sony.com>
>>>>>
>>>>> kbuild test robot reported a new warning for a recent patch:
>>>>>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration]
>>>>>      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
>>>>>
>>>>> The cause is that the prototype for of_fdt_unflatten_tree() in
>>>>> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE.
>>
>> Umm, this is not true. of_fdt_unflatten_tree is outside the ifdef for
>> OF_EARLY_FLATTREE.
> 
> Brown paper bag.  :-(  As you note below, CONFIG_OF_FLATTREE is the
> relevant option.


< snip >

> function, so it seems all is OK from that angle.  But all use of overlays 
> for many previous releases requires manually selecting OF_FLATTREE, given
> that FDTs have been the overlay source.

I was not correct about needing to manually select OF_FLATTREE.  For
the unittest of overlays, which did the overlay unflattening, OF_UNITTEST
selected (selects until my other patch series) OF_EARLY_FLATTREE, which
selects OF_FLATTREE.

-Frank

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

end of thread, other threads:[~2018-03-01 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19  0:29 [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE frowand.list
2018-02-19  1:46 ` Rob Herring
2018-02-19  6:24   ` Frank Rowand
2018-02-28 20:26     ` Rob Herring
2018-02-28 21:44       ` Frank Rowand
2018-03-01 16:14         ` Frank Rowand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.