Skip to content

Commit 997ba65

Browse files
afzalmamhdeller
authored andcommitted
parisc: 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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent c48b072 commit 997ba65

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

arch/parisc/kernel/irq.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -560,33 +560,23 @@ void do_cpu_irq_mask(struct pt_regs *regs)
560560
goto out;
561561
}
562562

563-
static struct irqaction timer_action = {
564-
.handler = timer_interrupt,
565-
.name = "timer",
566-
.flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL,
567-
};
568-
569-
#ifdef CONFIG_SMP
570-
static struct irqaction ipi_action = {
571-
.handler = ipi_interrupt,
572-
.name = "IPI",
573-
.flags = IRQF_PERCPU,
574-
};
575-
#endif
576-
577563
static void claim_cpu_irqs(void)
578564
{
565+
unsigned long flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL;
579566
int i;
567+
580568
for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
581569
irq_set_chip_and_handler(i, &cpu_interrupt_type,
582570
handle_percpu_irq);
583571
}
584572

585573
irq_set_handler(TIMER_IRQ, handle_percpu_irq);
586-
setup_irq(TIMER_IRQ, &timer_action);
574+
if (request_irq(TIMER_IRQ, timer_interrupt, flags, "timer", NULL))
575+
pr_err("Failed to register timer interrupt\n");
587576
#ifdef CONFIG_SMP
588577
irq_set_handler(IPI_IRQ, handle_percpu_irq);
589-
setup_irq(IPI_IRQ, &ipi_action);
578+
if (request_irq(IPI_IRQ, ipi_interrupt, IRQF_PERCPU, "IPI", NULL))
579+
pr_err("Failed to register IPI interrupt\n");
590580
#endif
591581
}
592582

drivers/parisc/eisa.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,6 @@ static irqreturn_t dummy_irq2_handler(int _, void *dev)
243243
return IRQ_HANDLED;
244244
}
245245

246-
static struct irqaction irq2_action = {
247-
.handler = dummy_irq2_handler,
248-
.name = "cascade",
249-
};
250-
251246
static void init_eisa_pic(void)
252247
{
253248
unsigned long flags;
@@ -335,7 +330,8 @@ static int __init eisa_probe(struct parisc_device *dev)
335330
}
336331

337332
/* Reserve IRQ2 */
338-
setup_irq(2, &irq2_action);
333+
if (request_irq(2, dummy_irq2_handler, 0, "cascade", NULL))
334+
pr_err("Failed to request irq 2 (cascade)\n");
339335
for (i = 0; i < 16; i++) {
340336
irq_set_chip_and_handler(i, &eisa_interrupt_type,
341337
handle_simple_irq);

0 commit comments

Comments
 (0)