diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-22 18:09:20 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-22 18:09:20 -0500 |
| commit | b4bbb02934e4511d9083f15c23e90703482e84ad (patch) | |
| tree | ebbff074e9bab458331d1c472e2f5ee854ff8d6e | |
| parent | 2db1125d51c4752ca68d1f015347b6f5b55e9fca (diff) | |
Revert "of/irq: of_irq_find_parent: check for parent equal to child"
This reverts commit dc9372808412edbc653a675a526c2ee6c0c14a91.
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 <benh@kernel.crashing.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Cc: Tanmay Inamdar <tinamdar@apm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | drivers/of/irq.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 6d3dd3988d0f..791270b8bd1c 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
| @@ -60,27 +60,27 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map); | |||
| 60 | */ | 60 | */ |
| 61 | struct device_node *of_irq_find_parent(struct device_node *child) | 61 | struct device_node *of_irq_find_parent(struct device_node *child) |
| 62 | { | 62 | { |
| 63 | struct device_node *p, *c = child; | 63 | struct device_node *p; |
| 64 | const __be32 *parp; | 64 | const __be32 *parp; |
| 65 | 65 | ||
| 66 | if (!of_node_get(c)) | 66 | if (!of_node_get(child)) |
| 67 | return NULL; | 67 | return NULL; |
| 68 | 68 | ||
| 69 | do { | 69 | do { |
| 70 | parp = of_get_property(c, "interrupt-parent", NULL); | 70 | parp = of_get_property(child, "interrupt-parent", NULL); |
| 71 | if (parp == NULL) | 71 | if (parp == NULL) |
| 72 | p = of_get_parent(c); | 72 | p = of_get_parent(child); |
| 73 | else { | 73 | else { |
| 74 | if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) | 74 | if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) |
| 75 | p = of_node_get(of_irq_dflt_pic); | 75 | p = of_node_get(of_irq_dflt_pic); |
| 76 | else | 76 | else |
| 77 | p = of_find_node_by_phandle(be32_to_cpup(parp)); | 77 | p = of_find_node_by_phandle(be32_to_cpup(parp)); |
| 78 | } | 78 | } |
| 79 | of_node_put(c); | 79 | of_node_put(child); |
| 80 | c = p; | 80 | child = p; |
| 81 | } while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL); | 81 | } while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL); |
| 82 | 82 | ||
| 83 | return (p == child) ? NULL : p; | 83 | return p; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | /** | 86 | /** |
