aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Cochran <rcochran@linutronix.de>2016-07-13 13:16:04 -0400
committerIngo Molnar <mingo@kernel.org>2016-07-14 03:34:28 -0400
commit93131f7a9b5c261f9995b4a6cbd7dbbec1351d2f (patch)
tree30ba5c9c4174ef4cc7b9ef71fa4c292eafe43d05
parent07d36c9e84002678d75b97d2361eb6302a718359 (diff)
irqchip/gic: Convert to hotplug state machine
More or less straightforward, although this driver sports some very interesting SMP setup code. Regarding the callback ordering, this deleted comment is interesting: ... the GIC needs to be up before the ARM generic timers. That comment is half baken as the same requirement is true for perf. Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Jason Cooper <jason@lakedaemon.net> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153333.069777215@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/irqchip/irq-gic.c23
-rw-r--r--include/linux/cpuhotplug.h1
2 files changed, 7 insertions, 17 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index fbc4ae2afd29..606f114166a1 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -984,25 +984,12 @@ static int gic_irq_domain_translate(struct irq_domain *d,
984 return -EINVAL; 984 return -EINVAL;
985} 985}
986 986
987#ifdef CONFIG_SMP 987static int gic_starting_cpu(unsigned int cpu)
988static int gic_secondary_init(struct notifier_block *nfb, unsigned long action,
989 void *hcpu)
990{ 988{
991 if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) 989 gic_cpu_init(&gic_data[0]);
992 gic_cpu_init(&gic_data[0]); 990 return 0;
993 return NOTIFY_OK;
994} 991}
995 992
996/*
997 * Notifier for enabling the GIC CPU interface. Set an arbitrarily high
998 * priority because the GIC needs to be up before the ARM generic timers.
999 */
1000static struct notifier_block gic_cpu_notifier = {
1001 .notifier_call = gic_secondary_init,
1002 .priority = 100,
1003};
1004#endif
1005
1006static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, 993static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
1007 unsigned int nr_irqs, void *arg) 994 unsigned int nr_irqs, void *arg)
1008{ 995{
@@ -1148,8 +1135,10 @@ static int __init __gic_init_bases(struct gic_chip_data *gic, int irq_start,
1148 gic_cpu_map[i] = 0xff; 1135 gic_cpu_map[i] = 0xff;
1149#ifdef CONFIG_SMP 1136#ifdef CONFIG_SMP
1150 set_smp_cross_call(gic_raise_softirq); 1137 set_smp_cross_call(gic_raise_softirq);
1151 register_cpu_notifier(&gic_cpu_notifier);
1152#endif 1138#endif
1139 cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_GIC_STARTING,
1140 "AP_IRQ_GIC_STARTING",
1141 gic_starting_cpu, NULL);
1153 set_handle_irq(gic_handle_irq); 1142 set_handle_irq(gic_handle_irq);
1154 if (static_key_true(&supports_deactivate)) 1143 if (static_key_true(&supports_deactivate))
1155 pr_info("GIC: Using split EOI/Deactivate mode\n"); 1144 pr_info("GIC: Using split EOI/Deactivate mode\n");
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index fe056408335e..edc8adf26410 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -9,6 +9,7 @@ enum cpuhp_state {
9 CPUHP_AP_IDLE_DEAD, 9 CPUHP_AP_IDLE_DEAD,
10 CPUHP_AP_OFFLINE, 10 CPUHP_AP_OFFLINE,
11 CPUHP_AP_SCHED_STARTING, 11 CPUHP_AP_SCHED_STARTING,
12 CPUHP_AP_IRQ_GIC_STARTING,
12 CPUHP_AP_NOTIFY_STARTING, 13 CPUHP_AP_NOTIFY_STARTING,
13 CPUHP_AP_ONLINE, 14 CPUHP_AP_ONLINE,
14 CPUHP_TEARDOWN_CPU, 15 CPUHP_TEARDOWN_CPU,