Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of/irq: Don't ignore interrupt-controller when interrupt-map failed

Since 041284181226 ("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: 041284181226 ("of/irq: Allow matching of an interrupt-map local to an interrupt controller")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/78308692-02e6-9544-4035-3171a8e1e6d4@xenosoft.de
Link: https://lore.kernel.org/r/20211112143644.434995-1-maz@kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>

+16 -3
+16 -3
drivers/of/irq.c
··· 161 161 * if it is then we are done, unless there is an 162 162 * interrupt-map which takes precedence. 163 163 */ 164 + bool intc = of_property_read_bool(ipar, "interrupt-controller"); 165 + 164 166 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) { 167 168 pr_debug(" -> got it !\n"); 168 169 return 0; 169 170 } ··· 245 244 246 245 pr_debug(" -> imaplen=%d\n", imaplen); 247 246 } 248 - if (!match) 247 + if (!match) { 248 + if (intc) { 249 + /* 250 + * The PASEMI Nemo is a known offender, so 251 + * let's only warn for anyone else. 252 + */ 253 + WARN(!IS_ENABLED(CONFIG_PPC_PASEMI), 254 + "%pOF interrupt-map failed, using interrupt-controller\n", 255 + ipar); 256 + return 0; 257 + } 258 + 249 259 goto fail; 260 + } 250 261 251 262 /* 252 263 * Successfully parsed an interrrupt-map translation; copy new