Skip to content

Commit

Permalink
checks: fix handling of unresolved phandles for dts plugins
Browse files Browse the repository at this point in the history
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: ee3d26f ("checks: add interrupts property check")
Fixes: b3bbac0 ("checks: add phandle with arg property checks")
Reported-by: Alan Tull <atull@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
robherring authored and dgibson committed Oct 19, 2017
1 parent f8872e2 commit c1e55a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c1e55a5

Please sign in to comment.