diff options
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
| -rw-r--r-- | drivers/irqchip/irq-gic.c | 28 | 
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 974f77c887b..add1fd84fc4 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -28,6 +28,7 @@  #include <linux/module.h>  #include <linux/list.h>  #include <linux/smp.h> +#include <linux/cpu.h>  #include <linux/cpu_pm.h>  #include <linux/cpumask.h>  #include <linux/io.h> @@ -699,6 +700,25 @@ static int gic_irq_domain_xlate(struct irq_domain *d,  	return 0;  } +#ifdef CONFIG_SMP +static int __cpuinit gic_secondary_init(struct notifier_block *nfb, +					unsigned long action, void *hcpu) +{ +	if (action == CPU_STARTING) +		gic_cpu_init(&gic_data[0]); +	return NOTIFY_OK; +} + +/* + * Notifier for enabling the GIC CPU interface. Set an arbitrarily high + * priority because the GIC needs to be up before the ARM generic timers. + */ +static struct notifier_block __cpuinitdata gic_cpu_notifier = { +	.notifier_call = gic_secondary_init, +	.priority = 100, +}; +#endif +  const struct irq_domain_ops gic_irq_domain_ops = {  	.map = gic_irq_domain_map,  	.xlate = gic_irq_domain_xlate, @@ -789,6 +809,7 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,  #ifdef CONFIG_SMP  	set_smp_cross_call(gic_raise_softirq); +	register_cpu_notifier(&gic_cpu_notifier);  #endif  	set_handle_irq(gic_handle_irq); @@ -799,13 +820,6 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,  	gic_pm_init(gic);  } -void __cpuinit gic_secondary_init(unsigned int gic_nr) -{ -	BUG_ON(gic_nr >= MAX_GIC_NR); - -	gic_cpu_init(&gic_data[gic_nr]); -} -  #ifdef CONFIG_OF  static int gic_cnt __initdata = 0;  |