aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/time.c
diff options
context:
space:
mode:
authorafzal mohammed <afzal.mohd.ma@gmail.com>2020-03-04 06:11:11 +0530
committerMax Filippov <jcmvbkbc@gmail.com>2020-03-03 18:40:26 -0800
commit98060484e2328a4d29b62eb42ef31219a4629587 (patch)
treef0ae7c518d95a8eb18c7b7b40a849c99b3dd1200 /arch/xtensa/kernel/time.c
parentLinux 5.6-rc4 (diff)
downloadlinux-dev-98060484e2328a4d29b62eb42ef31219a4629587.tar.xz
linux-dev-98060484e2328a4d29b62eb42ef31219a4629587.zip
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 <afzal.mohd.ma@gmail.com> Message-Id: <20200304004112.3848-1-afzal.mohd.ma@gmail.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to '')
-rw-r--r--arch/xtensa/kernel/time.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index 69db8c93c1f9..77971fe4cc95 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -128,12 +128,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static struct irqaction timer_irqaction = {
- .handler = timer_interrupt,
- .flags = IRQF_TIMER,
- .name = "timer",
-};
-
void local_timer_setup(unsigned cpu)
{
struct ccount_timer *timer = &per_cpu(ccount_timer, cpu);
@@ -184,6 +178,8 @@ static inline void calibrate_ccount(void)
void __init time_init(void)
{
+ int irq;
+
of_clk_init(NULL);
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
pr_info("Calibrating CPU frequency ");
@@ -199,7 +195,9 @@ void __init time_init(void)
__func__);
clocksource_register_hz(&ccount_clocksource, ccount_freq);
local_timer_setup(0);
- setup_irq(this_cpu_ptr(&ccount_timer)->evt.irq, &timer_irqaction);
+ irq = this_cpu_ptr(&ccount_timer)->evt.irq;
+ if (request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", NULL))
+ pr_err("Failed to request irq %d (timer)\n", irq);
sched_clock_register(ccount_sched_clock_read, 32, ccount_freq);
timer_probe();
}