Skip to content

Commit

Permalink
parisc: Replace setup_irq() by request_irq()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
afzalmam authored and hdeller committed Apr 5, 2020
1 parent c48b072 commit 997ba65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
22 changes: 6 additions & 16 deletions arch/parisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,33 +560,23 @@ void do_cpu_irq_mask(struct pt_regs *regs)
goto out;
}

static struct irqaction timer_action = {
.handler = timer_interrupt,
.name = "timer",
.flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL,
};

#ifdef CONFIG_SMP
static struct irqaction ipi_action = {
.handler = ipi_interrupt,
.name = "IPI",
.flags = IRQF_PERCPU,
};
#endif

static void claim_cpu_irqs(void)
{
unsigned long flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL;
int i;

for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
irq_set_chip_and_handler(i, &cpu_interrupt_type,
handle_percpu_irq);
}

irq_set_handler(TIMER_IRQ, handle_percpu_irq);
setup_irq(TIMER_IRQ, &timer_action);
if (request_irq(TIMER_IRQ, timer_interrupt, flags, "timer", NULL))
pr_err("Failed to register timer interrupt\n");
#ifdef CONFIG_SMP
irq_set_handler(IPI_IRQ, handle_percpu_irq);
setup_irq(IPI_IRQ, &ipi_action);
if (request_irq(IPI_IRQ, ipi_interrupt, IRQF_PERCPU, "IPI", NULL))
pr_err("Failed to register IPI interrupt\n");
#endif
}

Expand Down
8 changes: 2 additions & 6 deletions drivers/parisc/eisa.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,6 @@ static irqreturn_t dummy_irq2_handler(int _, void *dev)
return IRQ_HANDLED;
}

static struct irqaction irq2_action = {
.handler = dummy_irq2_handler,
.name = "cascade",
};

static void init_eisa_pic(void)
{
unsigned long flags;
Expand Down Expand Up @@ -335,7 +330,8 @@ static int __init eisa_probe(struct parisc_device *dev)
}

/* Reserve IRQ2 */
setup_irq(2, &irq2_action);
if (request_irq(2, dummy_irq2_handler, 0, "cascade", NULL))
pr_err("Failed to request irq 2 (cascade)\n");
for (i = 0; i < 16; i++) {
irq_set_chip_and_handler(i, &eisa_interrupt_type,
handle_simple_irq);
Expand Down

0 comments on commit 997ba65

Please sign in to comment.