From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849AbcGSG7O (ORCPT ); Tue, 19 Jul 2016 02:59:14 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44592 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbcGSG7L (ORCPT ); Tue, 19 Jul 2016 02:59:11 -0400 Date: Mon, 18 Jul 2016 23:58:36 -0700 From: tip-bot for Richard Cochran Message-ID: Cc: mingo@kernel.org, peterz@infradead.org, anna-maria@linutronix.de, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, hpa@zytor.com, tglx@linutronix.de, jason@lakedaemon.net, torvalds@linux-foundation.org, rcochran@linutronix.de, marc.zyngier@arm.com Reply-To: jason@lakedaemon.net, tglx@linutronix.de, marc.zyngier@arm.com, rcochran@linutronix.de, torvalds@linux-foundation.org, anna-maria@linutronix.de, peterz@infradead.org, mingo@kernel.org, hpa@zytor.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <20160713153333.069777215@linutronix.de> References: <20160713153333.069777215@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] irqchip/gic: Convert to hotplug state machine Git-Commit-ID: 93131f7a9b5c261f9995b4a6cbd7dbbec1351d2f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 93131f7a9b5c261f9995b4a6cbd7dbbec1351d2f Gitweb: http://git.kernel.org/tip/93131f7a9b5c261f9995b4a6cbd7dbbec1351d2f Author: Richard Cochran AuthorDate: Wed, 13 Jul 2016 17:16:04 +0000 Committer: Ingo Molnar CommitDate: Thu, 14 Jul 2016 09:34:28 +0200 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 Signed-off-by: Anna-Maria Gleixner Reviewed-by: Sebastian Andrzej Siewior Acked-by: Jason Cooper Cc: Linus Torvalds Cc: Marc Zyngier Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153333.069777215@linutronix.de Signed-off-by: Ingo Molnar --- drivers/irqchip/irq-gic.c | 23 ++++++----------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index fbc4ae2..606f114 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, 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(struct gic_chip_data *gic, int irq_start, 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"); diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index fe05640..edc8adf 100644 --- 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,