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

irqchip/xtensa-mx: Fix initial IRQ affinity in non-SMP setup

When irq-xtensa-mx chip is used in non-SMP configuration its
irq_set_affinity callback is not called leaving IRQ affinity set empty.
As a result IRQ delivery does not work in that configuration.
Initialize IRQ affinity of the xtensa MX interrupt distributor to CPU 0
for all external IRQ lines.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220426161912.1113784-1-jcmvbkbc@gmail.com

authored by

Max Filippov and committed by
Marc Zyngier
168f633b 4efc851c

+14 -4
+14 -4
drivers/irqchip/irq-xtensa-mx.c
··· 151 151 .irq_set_affinity = xtensa_mx_irq_set_affinity, 152 152 }; 153 153 154 + static void __init xtensa_mx_init_common(struct irq_domain *root_domain) 155 + { 156 + unsigned int i; 157 + 158 + irq_set_default_host(root_domain); 159 + secondary_init_irq(); 160 + 161 + /* Initialize default IRQ routing to CPU 0 */ 162 + for (i = 0; i < XCHAL_NUM_EXTINTERRUPTS; ++i) 163 + set_er(1, MIROUT(i)); 164 + } 165 + 154 166 int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent) 155 167 { 156 168 struct irq_domain *root_domain = 157 169 irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0, 158 170 &xtensa_mx_irq_domain_ops, 159 171 &xtensa_mx_irq_chip); 160 - irq_set_default_host(root_domain); 161 - secondary_init_irq(); 172 + xtensa_mx_init_common(root_domain); 162 173 return 0; 163 174 } 164 175 ··· 179 168 struct irq_domain *root_domain = 180 169 irq_domain_add_linear(np, NR_IRQS, &xtensa_mx_irq_domain_ops, 181 170 &xtensa_mx_irq_chip); 182 - irq_set_default_host(root_domain); 183 - secondary_init_irq(); 171 + xtensa_mx_init_common(root_domain); 184 172 return 0; 185 173 } 186 174 IRQCHIP_DECLARE(xtensa_mx_irq_chip, "cdns,xtensa-mx", xtensa_mx_init);