Commit 45b26dde authored by afzal mohammed's avatar afzal mohammed Committed by Thomas Gleixner

hexagon: Replace setup_irq() by request_irq()

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

setup_irq() was required in older kernels as the memory allocator was not
available during early boot.

Hence replace setup_irq() by request_irq().
Signed-off-by: default avatarafzal mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/e84ac60de8f747d49ce082659e51595f708c29d4.1585320721.git.afzal.mohd.ma@gmail.com
parent e13b99f3
...@@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg) ...@@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg)
local_irq_restore(flags); local_irq_restore(flags);
} }
static struct irqaction ipi_intdesc = {
.handler = handle_ipi,
.flags = IRQF_TRIGGER_RISING,
.name = "ipi_handler"
};
void __init smp_prepare_boot_cpu(void) void __init smp_prepare_boot_cpu(void)
{ {
} }
...@@ -132,8 +126,8 @@ void __init smp_prepare_boot_cpu(void) ...@@ -132,8 +126,8 @@ void __init smp_prepare_boot_cpu(void)
void start_secondary(void) void start_secondary(void)
{ {
unsigned int cpu;
unsigned long thread_ptr; unsigned long thread_ptr;
unsigned int cpu, irq;
/* Calculate thread_info pointer from stack pointer */ /* Calculate thread_info pointer from stack pointer */
__asm__ __volatile__( __asm__ __volatile__(
...@@ -155,7 +149,10 @@ void start_secondary(void) ...@@ -155,7 +149,10 @@ void start_secondary(void)
cpu = smp_processor_id(); cpu = smp_processor_id();
setup_irq(BASE_IPI_IRQ + cpu, &ipi_intdesc); irq = BASE_IPI_IRQ + cpu;
if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING, "ipi_handler",
NULL))
pr_err("Failed to request irq %u (ipi_handler)\n", irq);
/* Register the clock_event dummy */ /* Register the clock_event dummy */
setup_percpu_clockdev(); setup_percpu_clockdev();
...@@ -201,7 +198,7 @@ void __init smp_cpus_done(unsigned int max_cpus) ...@@ -201,7 +198,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
void __init smp_prepare_cpus(unsigned int max_cpus) void __init smp_prepare_cpus(unsigned int max_cpus)
{ {
int i; int i, irq = BASE_IPI_IRQ;
/* /*
* should eventually have some sort of machine * should eventually have some sort of machine
...@@ -213,8 +210,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus) ...@@ -213,8 +210,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
set_cpu_present(i, true); set_cpu_present(i, true);
/* Also need to register the interrupts for IPI */ /* Also need to register the interrupts for IPI */
if (max_cpus > 1) if (max_cpus > 1) {
setup_irq(BASE_IPI_IRQ, &ipi_intdesc); if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING,
"ipi_handler", NULL))
pr_err("Failed to request irq %d (ipi_handler)\n", irq);
}
} }
void smp_send_reschedule(int cpu) void smp_send_reschedule(int cpu)
......
...@@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid) ...@@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* This should also be pulled from devtree */
static struct irqaction rtos_timer_intdesc = {
.handler = timer_interrupt,
.flags = IRQF_TIMER | IRQF_TRIGGER_RISING,
.name = "rtos_timer"
};
/* /*
* time_init_deferred - called by start_kernel to set up timer/clock source * time_init_deferred - called by start_kernel to set up timer/clock source
* *
...@@ -163,6 +156,7 @@ void __init time_init_deferred(void) ...@@ -163,6 +156,7 @@ void __init time_init_deferred(void)
{ {
struct resource *resource = NULL; struct resource *resource = NULL;
struct clock_event_device *ce_dev = &hexagon_clockevent_dev; struct clock_event_device *ce_dev = &hexagon_clockevent_dev;
unsigned long flag = IRQF_TIMER | IRQF_TRIGGER_RISING;
ce_dev->cpumask = cpu_all_mask; ce_dev->cpumask = cpu_all_mask;
...@@ -195,7 +189,8 @@ void __init time_init_deferred(void) ...@@ -195,7 +189,8 @@ void __init time_init_deferred(void)
#endif #endif
clockevents_register_device(ce_dev); clockevents_register_device(ce_dev);
setup_irq(ce_dev->irq, &rtos_timer_intdesc); if (request_irq(ce_dev->irq, timer_interrupt, flag, "rtos_timer", NULL))
pr_err("Failed to register rtos_timer interrupt\n");
} }
void __init time_init(void) void __init time_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment