Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440573

[patch 02/66] irqchip/gic: Convert to hotplug state machine

From Anna-Maria Gleixner <anna-maria@linutronix.de>
Newsgroups linux.kernel
Subject [patch 02/66] irqchip/gic: Convert to hotplug state machine
Date 2016-07-11 14:50 +0200
Message-ID <rTIOS-762-7@gated-at.bofh.it> (permalink)
References <rTIFb-70u-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 drivers/irqchip/irq-gic.c  |   23 ++++++-----------------
 include/linux/cpuhotplug.h |    1 +
 2 files changed, 7 insertions(+), 17 deletions(-)

--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -984,25 +984,12 @@ static int gic_irq_domain_translate(stru
 	return -EINVAL;
 }
 
-#ifdef CONFIG_SMP
-static int gic_secondary_init(struct notifier_block *nfb, unsigned long action,
-			      void *hcpu)
+static int gic_starting_cpu(unsigned int cpu)
 {
-	if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
-		gic_cpu_init(&gic_data[0]);
-	return NOTIFY_OK;
+	gic_cpu_init(&gic_data[0]);
+	return 0;
 }
 
-/*
- * 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 gic_cpu_notifier = {
-	.notifier_call = gic_secondary_init,
-	.priority = 100,
-};
-#endif
-
 static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
 				unsigned int nr_irqs, void *arg)
 {
@@ -1148,8 +1135,10 @@ static int __init __gic_init_bases(struc
 			gic_cpu_map[i] = 0xff;
 #ifdef CONFIG_SMP
 		set_smp_cross_call(gic_raise_softirq);
-		register_cpu_notifier(&gic_cpu_notifier);
 #endif
+		cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_GIC_STARTING,
+					  "AP_IRQ_GIC_STARTING",
+					  gic_starting_cpu, NULL);
 		set_handle_irq(gic_handle_irq);
 		if (static_key_true(&supports_deactivate))
 			pr_info("GIC: Using split EOI/Deactivate mode\n");
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -9,6 +9,7 @@ enum cpuhp_state {
 	CPUHP_AP_IDLE_DEAD,
 	CPUHP_AP_OFFLINE,
 	CPUHP_AP_SCHED_STARTING,
+	CPUHP_AP_IRQ_GIC_STARTING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,
 	CPUHP_TEARDOWN_CPU,

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[patch 02/66] irqchip/gic: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-11 14:50 +0200
  Re: [patch 02/66] irqchip/gic: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-11 16:40 +0200
    Re: [patch 02/66] irqchip/gic: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-11 16:50 +0200

csiph-web