Skip to content

Commit

Permalink
Revert "of/irq: of_irq_find_parent: check for parent equal to child"
Browse files Browse the repository at this point in the history
This reverts commit dc93728.

As requested by Ben Herrenschmidt:
  "This breaks some powerpc platforms at least.  The practice of having
   a node provide an explicit "interrupt-parent" property pointing to
   itself is an old trick that we've used in the past to allow a
   device-node to have interrupts routed to different controllers.

   In that case, the node also contains an interrupt-map, so the node is
   its own parent, the interrupt resolution hits the map, which then can
   route each individual interrupt to a different parent."

Grant says:
  "Ah, nuts, yes that is broken then.  Yes, please revert the commit and
   Rob & I will come up with a better solution.

   Rob, I think it can be done by explicitly checking for np ==
   desc->interrupt_parent in of_irq_init() instead of relying on
   of_irq_find_parent() returning NULL."

Requested-by: Benjamin Herrenschmidt <[email protected]>
Acked-by: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: linuxppc-dev <[email protected]>
Cc: Tanmay Inamdar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Nov 22, 2011
1 parent 2db1125 commit b4bbb02
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/of/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,27 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
*/
struct device_node *of_irq_find_parent(struct device_node *child)
{
struct device_node *p, *c = child;
struct device_node *p;
const __be32 *parp;

if (!of_node_get(c))
if (!of_node_get(child))
return NULL;

do {
parp = of_get_property(c, "interrupt-parent", NULL);
parp = of_get_property(child, "interrupt-parent", NULL);
if (parp == NULL)
p = of_get_parent(c);
p = of_get_parent(child);
else {
if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
p = of_node_get(of_irq_dflt_pic);
else
p = of_find_node_by_phandle(be32_to_cpup(parp));
}
of_node_put(c);
c = p;
of_node_put(child);
child = p;
} while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL);

return (p == child) ? NULL : p;
return p;
}

/**
Expand Down

0 comments on commit b4bbb02

Please sign in to comment.