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

irqchip: Replace setup_irq() by request_irq()

request_irq() is preferred over setup_irq(). Invocations of setup_irq()
occur after memory allocators are ready.

Per tglx[1], setup_irq() existed in olden days when allocators were not
ready by the time early interrupts were initialized.

Hence replace setup_irq() by request_irq().

[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos

Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200304004839.4729-1-afzal.mohd.ma@gmail.com

authored by

afzal mohammed and committed by
Marc Zyngier
2ef1cb76 bc714c8b

+9 -16
+6 -10
drivers/irqchip/irq-i8259.c
··· 268 268 raw_spin_unlock_irqrestore(&i8259A_lock, flags); 269 269 } 270 270 271 - /* 272 - * IRQ2 is cascade interrupt to second interrupt controller 273 - */ 274 - static struct irqaction irq2 = { 275 - .handler = no_action, 276 - .name = "cascade", 277 - .flags = IRQF_NO_THREAD, 278 - }; 279 - 280 271 static struct resource pic1_io_resource = { 281 272 .name = "pic1", 282 273 .start = PIC_MASTER_CMD, ··· 302 311 */ 303 312 struct irq_domain * __init __init_i8259_irqs(struct device_node *node) 304 313 { 314 + /* 315 + * PIC_CASCADE_IR is cascade interrupt to second interrupt controller 316 + */ 317 + int irq = I8259A_IRQ_BASE + PIC_CASCADE_IR; 305 318 struct irq_domain *domain; 306 319 307 320 insert_resource(&ioport_resource, &pic1_io_resource); ··· 318 323 if (!domain) 319 324 panic("Failed to add i8259 IRQ domain"); 320 325 321 - setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2); 326 + if (request_irq(irq, no_action, IRQF_NO_THREAD, "cascade", NULL)) 327 + pr_err("Failed to register cascade interrupt\n"); 322 328 register_syscore_ops(&i8259_syscore_ops); 323 329 return domain; 324 330 }
+3 -6
drivers/irqchip/irq-ingenic.c
··· 58 58 return IRQ_HANDLED; 59 59 } 60 60 61 - static struct irqaction intc_cascade_action = { 62 - .handler = intc_cascade, 63 - .name = "SoC intc cascade interrupt", 64 - }; 65 - 66 61 static int __init ingenic_intc_of_init(struct device_node *node, 67 62 unsigned num_chips) 68 63 { ··· 125 130 irq_reg_writel(gc, IRQ_MSK(32), JZ_REG_INTC_SET_MASK); 126 131 } 127 132 128 - setup_irq(parent_irq, &intc_cascade_action); 133 + if (request_irq(parent_irq, intc_cascade, 0, 134 + "SoC intc cascade interrupt", NULL)) 135 + pr_err("Failed to register SoC intc cascade interrupt\n"); 129 136 return 0; 130 137 131 138 out_domain_remove: