Skip to content

Commit 9806048

Browse files
afzalmamjcmvbkbc
authored andcommitted
xtensa: 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]> Message-Id: <[email protected]> Signed-off-by: Max Filippov <[email protected]>
1 parent 98d54f8 commit 9806048

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

arch/xtensa/kernel/smp.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,12 @@ static void system_flush_invalidate_dcache_range(unsigned long start,
5353
#define IPI_IRQ 0
5454

5555
static irqreturn_t ipi_interrupt(int irq, void *dev_id);
56-
static struct irqaction ipi_irqaction = {
57-
.handler = ipi_interrupt,
58-
.flags = IRQF_PERCPU,
59-
.name = "ipi",
60-
};
6156

6257
void ipi_init(void)
6358
{
6459
unsigned irq = irq_create_mapping(NULL, IPI_IRQ);
65-
setup_irq(irq, &ipi_irqaction);
60+
if (request_irq(irq, ipi_interrupt, IRQF_PERCPU, "ipi", NULL))
61+
pr_err("Failed to request irq %u (ipi)\n", irq);
6662
}
6763

6864
static inline unsigned int get_core_count(void)

arch/xtensa/kernel/time.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
128128
return IRQ_HANDLED;
129129
}
130130

131-
static struct irqaction timer_irqaction = {
132-
.handler = timer_interrupt,
133-
.flags = IRQF_TIMER,
134-
.name = "timer",
135-
};
136-
137131
void local_timer_setup(unsigned cpu)
138132
{
139133
struct ccount_timer *timer = &per_cpu(ccount_timer, cpu);
@@ -184,6 +178,8 @@ static inline void calibrate_ccount(void)
184178

185179
void __init time_init(void)
186180
{
181+
int irq;
182+
187183
of_clk_init(NULL);
188184
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
189185
pr_info("Calibrating CPU frequency ");
@@ -199,7 +195,9 @@ void __init time_init(void)
199195
__func__);
200196
clocksource_register_hz(&ccount_clocksource, ccount_freq);
201197
local_timer_setup(0);
202-
setup_irq(this_cpu_ptr(&ccount_timer)->evt.irq, &timer_irqaction);
198+
irq = this_cpu_ptr(&ccount_timer)->evt.irq;
199+
if (request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", NULL))
200+
pr_err("Failed to request irq %d (timer)\n", irq);
203201
sched_clock_register(ccount_sched_clock_read, 32, ccount_freq);
204202
timer_probe();
205203
}

0 commit comments

Comments
 (0)