diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2013-01-14 13:05:37 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-03-26 12:12:02 -0400 |
commit | c0114709ed85a5693eb74acdfa03d94f7f12e5b8 (patch) | |
tree | 372c5cee96580d73e638d25a2b169a64b82bc908 /drivers/irqchip | |
parent | aec0095653cd9812b9a15df0315364cc6d094c59 (diff) |
irqchip: gic: Perform the gic_secondary_init() call via CPU notifier
All the calls to gic_secondary_init() pass 0 as the first argument.
Since this function is called on each CPU when starting, it can be done
in a platform-independent way via a CPU notifier registered by the GIC
code.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Tested-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Barry Song <baohua.song@csr.com>
Diffstat (limited to 'drivers/irqchip')
-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 974f77c887b8..add1fd84fc4b 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
31 | #include <linux/cpu.h> | ||
31 | #include <linux/cpu_pm.h> | 32 | #include <linux/cpu_pm.h> |
32 | #include <linux/cpumask.h> | 33 | #include <linux/cpumask.h> |
33 | #include <linux/io.h> | 34 | #include <linux/io.h> |
@@ -699,6 +700,25 @@ static int gic_irq_domain_xlate(struct irq_domain *d, | |||
699 | return 0; | 700 | return 0; |
700 | } | 701 | } |
701 | 702 | ||
703 | #ifdef CONFIG_SMP | ||
704 | static int __cpuinit gic_secondary_init(struct notifier_block *nfb, | ||
705 | unsigned long action, void *hcpu) | ||
706 | { | ||
707 | if (action == CPU_STARTING) | ||
708 | gic_cpu_init(&gic_data[0]); | ||
709 | return NOTIFY_OK; | ||
710 | } | ||
711 | |||
712 | /* | ||
713 | * Notifier for enabling the GIC CPU interface. Set an arbitrarily high | ||
714 | * priority because the GIC needs to be up before the ARM generic timers. | ||
715 | */ | ||
716 | static struct notifier_block __cpuinitdata gic_cpu_notifier = { | ||
717 | .notifier_call = gic_secondary_init, | ||
718 | .priority = 100, | ||
719 | }; | ||
720 | #endif | ||
721 | |||
702 | const struct irq_domain_ops gic_irq_domain_ops = { | 722 | const struct irq_domain_ops gic_irq_domain_ops = { |
703 | .map = gic_irq_domain_map, | 723 | .map = gic_irq_domain_map, |
704 | .xlate = gic_irq_domain_xlate, | 724 | .xlate = gic_irq_domain_xlate, |
@@ -789,6 +809,7 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
789 | 809 | ||
790 | #ifdef CONFIG_SMP | 810 | #ifdef CONFIG_SMP |
791 | set_smp_cross_call(gic_raise_softirq); | 811 | set_smp_cross_call(gic_raise_softirq); |
812 | register_cpu_notifier(&gic_cpu_notifier); | ||
792 | #endif | 813 | #endif |
793 | 814 | ||
794 | set_handle_irq(gic_handle_irq); | 815 | set_handle_irq(gic_handle_irq); |
@@ -799,13 +820,6 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
799 | gic_pm_init(gic); | 820 | gic_pm_init(gic); |
800 | } | 821 | } |
801 | 822 | ||
802 | void __cpuinit gic_secondary_init(unsigned int gic_nr) | ||
803 | { | ||
804 | BUG_ON(gic_nr >= MAX_GIC_NR); | ||
805 | |||
806 | gic_cpu_init(&gic_data[gic_nr]); | ||
807 | } | ||
808 | |||
809 | #ifdef CONFIG_OF | 823 | #ifdef CONFIG_OF |
810 | static int gic_cnt __initdata = 0; | 824 | static int gic_cnt __initdata = 0; |
811 | 825 | ||