devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Alan Tull <atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] checks: fix handling of unresolved phandles for dts plugins
Date: Wed, 18 Oct 2017 16:29:14 -0500	[thread overview]
Message-ID: <20171018212914.13703-1-robh@kernel.org> (raw)

In dts plugins, it is valid to have unresolved phandle values. The
check_property_phandle_args and check_interrupts_property checks failed to
account for this resulting in spurious warnings or asserts, respectively.
Fix this by bailing from the checks if we're checking a dts plugin as
there is no way to further validate the properties.

Fixes: ee3d26f6960b ("checks: add interrupts property check")
Fixes: b3bbac02d5e3 ("checks: add phandle with arg property checks")
Reported-by: Alan Tull <atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 checks.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/checks.c b/checks.c
index 08a3a29edae3..e66138449886 100644
--- a/checks.c
+++ b/checks.c
@@ -988,6 +988,10 @@ static void check_property_phandle_args(struct check *c,
 		 * entries when each index position has a specific definition.
 		 */
 		if (phandle == 0 || phandle == -1) {
+			/* Give up if this is an overlay with external references */
+			if (dti->dtsflags & DTSF_PLUGIN)
+				break;
+
 			cellsize = 0;
 			continue;
 		}
@@ -1176,6 +1180,11 @@ static void check_interrupts_property(struct check *c,
 		prop = get_property(parent, "interrupt-parent");
 		if (prop) {
 			phandle = propval_cell(prop);
+			/* Give up if this is an overlay with external references */
+			if ((phandle == 0 || phandle == -1) &&
+			    (dti->dtsflags & DTSF_PLUGIN))
+					return;
+
 			irq_node = get_node_by_phandle(root, phandle);
 			if (!irq_node) {
 				FAIL(c, dti, "Bad interrupt-parent phandle for %s",
-- 
2.11.0

             reply	other threads:[~2017-10-18 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 21:29 Rob Herring [this message]
     [not found] ` <20171018212914.13703-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-19  1:32   ` [PATCH] checks: fix handling of unresolved phandles for dts plugins David Gibson
2017-10-19 16:18   ` Alan Tull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171018212914.13703-1-robh@kernel.org \
    --to=robh-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).