All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] livetree: avoid assertion of orphan phandles with overlays
@ 2017-10-24 14:14 Tero Kristo
       [not found] ` <1508854458-9937-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Tero Kristo @ 2017-10-24 14:14 UTC (permalink / raw
  To: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+
  Cc: pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	robherring2-Re5JQEeQqe8AvxtiuMwx3w, sjg-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Right now, check_interrupts_property fails with overlays, as the phandle
for the interrupt-parent can be orphan. Avoid this by allowing the orphan
node to pass the assert check.

The process_checks() call is also moved later during init sequence,
so that we can use the global variable generate_fixups to check if
we are compiling an overlay.

Signed-off-by: Tero Kristo <t-kristo-l0cyMroinI0@public.gmane.org>
---
 dtc.c      | 3 ++-
 livetree.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dtc.c b/dtc.c
index 5ed873c..a0f4603 100644
--- a/dtc.c
+++ b/dtc.c
@@ -319,13 +319,14 @@ int main(int argc, char *argv[])
 		dti->boot_cpuid_phys = cmdline_boot_cpuid;
 
 	fill_fullpaths(dti->dt, "");
-	process_checks(force, dti);
 
 	/* on a plugin, generate by default */
 	if (dti->dtsflags & DTSF_PLUGIN) {
 		generate_fixups = 1;
 	}
 
+	process_checks(force, dti);
+
 	if (auto_label_aliases)
 		generate_label_tree(dti, "aliases", false);
 
diff --git a/livetree.c b/livetree.c
index 6846ad2..d6a7681 100644
--- a/livetree.c
+++ b/livetree.c
@@ -540,7 +540,7 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
 {
 	struct node *child, *node;
 
-	assert((phandle != 0) && (phandle != -1));
+	assert((phandle != 0 && (phandle != -1 || generate_fixups == 1)));
 
 	if (tree->phandle == phandle) {
 		if (tree->deleted)
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH] livetree: avoid assertion of orphan phandles with overlays
       [not found] ` <1508854458-9937-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
@ 2017-10-24 15:21   ` Rob Herring
       [not found]     ` <CAL_JsqJAPKYf25pW-4awUHpovq-fxesG-E_rYjh8MGufVSYRBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-10-27 14:33   ` David Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Herring @ 2017-10-24 15:21 UTC (permalink / raw
  To: Tero Kristo
  Cc: David Gibson, Pantelis Antoniou, Frank Rowand, Simon Glass,
	Devicetree Compiler,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Tue, Oct 24, 2017 at 9:14 AM, Tero Kristo <t-kristo-l0cyMroinI0@public.gmane.org> wrote:
> Right now, check_interrupts_property fails with overlays, as the phandle
> for the interrupt-parent can be orphan. Avoid this by allowing the orphan
> node to pass the assert check.
>
> The process_checks() call is also moved later during init sequence,
> so that we can use the global variable generate_fixups to check if
> we are compiling an overlay.

This is fixed by [1].

David, BTW, you didn't push to kernel.org dtc repo. That's still the
"official" one?

Rob

[1] https://github.com/dgibson/dtc/commit/c1e55a5513e9bca41dc78a0f20245cc928596a3a
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] livetree: avoid assertion of orphan phandles with overlays
       [not found]     ` <CAL_JsqJAPKYf25pW-4awUHpovq-fxesG-E_rYjh8MGufVSYRBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-10-24 16:07       ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2017-10-24 16:07 UTC (permalink / raw
  To: Rob Herring
  Cc: Tero Kristo, Pantelis Antoniou, Frank Rowand, Simon Glass,
	Devicetree Compiler,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

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

On Tue, Oct 24, 2017 at 10:21:10AM -0500, Rob Herring wrote:
> On Tue, Oct 24, 2017 at 9:14 AM, Tero Kristo <t-kristo-l0cyMroinI0@public.gmane.org> wrote:
> > Right now, check_interrupts_property fails with overlays, as the phandle
> > for the interrupt-parent can be orphan. Avoid this by allowing the orphan
> > node to pass the assert check.
> >
> > The process_checks() call is also moved later during init sequence,
> > so that we can use the global variable generate_fixups to check if
> > we are compiling an overlay.
> 
> This is fixed by [1].
> 
> David, BTW, you didn't push to kernel.org dtc repo. That's still the
> "official" one?

Yess.  I usually push to github first, wait for the Travis build to
complete then push to kernel.org, but I got distracted and forgot to
finish that.  Fixed now.

> 
> Rob
> 
> [1] https://github.com/dgibson/dtc/commit/c1e55a5513e9bca41dc78a0f20245cc928596a3a
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] livetree: avoid assertion of orphan phandles with overlays
       [not found] ` <1508854458-9937-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
  2017-10-24 15:21   ` Rob Herring
@ 2017-10-27 14:33   ` David Gibson
  1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2017-10-27 14:33 UTC (permalink / raw
  To: Tero Kristo
  Cc: pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	robherring2-Re5JQEeQqe8AvxtiuMwx3w, sjg-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Tue, Oct 24, 2017 at 05:14:18PM +0300, Tero Kristo wrote:
> Right now, check_interrupts_property fails with overlays, as the phandle
> for the interrupt-parent can be orphan. Avoid this by allowing the orphan
> node to pass the assert check.
> 
> The process_checks() call is also moved later during init sequence,
> so that we can use the global variable generate_fixups to check if
> we are compiling an overlay.
> 
> Signed-off-by: Tero Kristo <t-kristo-l0cyMroinI0@public.gmane.org>

Applied, with a bit of a tweak.

> ---
>  dtc.c      | 3 ++-
>  livetree.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/dtc.c b/dtc.c
> index 5ed873c..a0f4603 100644
> --- a/dtc.c
> +++ b/dtc.c
> @@ -319,13 +319,14 @@ int main(int argc, char *argv[])
>  		dti->boot_cpuid_phys = cmdline_boot_cpuid;
>  
>  	fill_fullpaths(dti->dt, "");
> -	process_checks(force, dti);
>  
>  	/* on a plugin, generate by default */
>  	if (dti->dtsflags & DTSF_PLUGIN) {
>  		generate_fixups = 1;
>  	}
>  
> +	process_checks(force, dti);
> +
>  	if (auto_label_aliases)
>  		generate_label_tree(dti, "aliases", false);
>  
> diff --git a/livetree.c b/livetree.c
> index 6846ad2..d6a7681 100644
> --- a/livetree.c
> +++ b/livetree.c
> @@ -540,7 +540,7 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
>  {
>  	struct node *child, *node;
>  
> -	assert((phandle != 0) && (phandle != -1));
> +	assert((phandle != 0 && (phandle != -1 || generate_fixups == 1)));
>  
>  	if (tree->phandle == phandle) {
>  		if (tree->deleted)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-10-27 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 14:14 [PATCH] livetree: avoid assertion of orphan phandles with overlays Tero Kristo
     [not found] ` <1508854458-9937-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2017-10-24 15:21   ` Rob Herring
     [not found]     ` <CAL_JsqJAPKYf25pW-4awUHpovq-fxesG-E_rYjh8MGufVSYRBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-24 16:07       ` David Gibson
2017-10-27 14:33   ` David Gibson

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.