Skip to content

Commit 10a20b3

Browse files
author
Marc Zyngier
committed
of/irq: Don't ignore interrupt-controller when interrupt-map failed
Since 0412841 ("of/irq: Allow matching of an interrupt-map local to an interrupt controller"), the irq code favors using an interrupt-map over a interrupt-controller property if both are available, while the earlier behaviour was to ignore the interrupt-map altogether. However, we now end-up with the opposite behaviour, which is to ignore the interrupt-controller property even if the interrupt-map fails to match its input. This new behaviour breaks the AmigaOne X1000 machine, which ships with an extremely "creative" (read: broken) device tree. Fix this by allowing the interrupt-controller property to be selected when interrupt-map fails to match anything. Fixes: 0412841 ("of/irq: Allow matching of an interrupt-map local to an interrupt controller") Reported-by: Christian Zigotzky <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Cc: Bjorn Helgaas <[email protected]>
1 parent 69ea463 commit 10a20b3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

drivers/of/irq.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
161161
* if it is then we are done, unless there is an
162162
* interrupt-map which takes precedence.
163163
*/
164+
bool intc = of_property_read_bool(ipar, "interrupt-controller");
165+
164166
imap = of_get_property(ipar, "interrupt-map", &imaplen);
165-
if (imap == NULL &&
166-
of_property_read_bool(ipar, "interrupt-controller")) {
167+
if (imap == NULL && intc) {
167168
pr_debug(" -> got it !\n");
168169
return 0;
169170
}
@@ -244,8 +245,20 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
244245

245246
pr_debug(" -> imaplen=%d\n", imaplen);
246247
}
247-
if (!match)
248+
if (!match) {
249+
if (intc) {
250+
/*
251+
* The PASEMI Nemo is a known offender, so
252+
* let's only warn for anyone else.
253+
*/
254+
WARN(!IS_ENABLED(CONFIG_PPC_PASEMI),
255+
"%pOF interrupt-map failed, using interrupt-controller\n",
256+
ipar);
257+
return 0;
258+
}
259+
248260
goto fail;
261+
}
249262

250263
/*
251264
* Successfully parsed an interrrupt-map translation; copy new

0 commit comments

Comments
 (0)