aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-09-06 13:04:40 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-19 15:44:26 -0400
commit6b8d642239e866debbaa37f25e53837a5d141f33 (patch)
tree1cca2bc758c6f4678a004515f0232f2ba98b0179
parenta4fa9cc220fef29162d38a0ada71f5569a116087 (diff)
ia64/mca: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: linux-ia64@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160906170457.32393-5-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/ia64/kernel/mca.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index eb9220cde76c..c2858865b146 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1890,7 +1890,7 @@ ia64_mca_cpu_init(void *cpu_data)
1890 PAGE_KERNEL))); 1890 PAGE_KERNEL)));
1891} 1891}
1892 1892
1893static void ia64_mca_cmc_vector_adjust(void *dummy) 1893static int ia64_mca_cpu_online(unsigned int cpu)
1894{ 1894{
1895 unsigned long flags; 1895 unsigned long flags;
1896 1896
@@ -1898,25 +1898,9 @@ static void ia64_mca_cmc_vector_adjust(void *dummy)
1898 if (!cmc_polling_enabled) 1898 if (!cmc_polling_enabled)
1899 ia64_mca_cmc_vector_enable(NULL); 1899 ia64_mca_cmc_vector_enable(NULL);
1900 local_irq_restore(flags); 1900 local_irq_restore(flags);
1901 return 0;
1901} 1902}
1902 1903
1903static int mca_cpu_callback(struct notifier_block *nfb,
1904 unsigned long action,
1905 void *hcpu)
1906{
1907 switch (action) {
1908 case CPU_ONLINE:
1909 case CPU_ONLINE_FROZEN:
1910 ia64_mca_cmc_vector_adjust(NULL);
1911 break;
1912 }
1913 return NOTIFY_OK;
1914}
1915
1916static struct notifier_block mca_cpu_notifier = {
1917 .notifier_call = mca_cpu_callback
1918};
1919
1920/* 1904/*
1921 * ia64_mca_init 1905 * ia64_mca_init
1922 * 1906 *
@@ -2111,15 +2095,13 @@ ia64_mca_late_init(void)
2111 if (!mca_init) 2095 if (!mca_init)
2112 return 0; 2096 return 0;
2113 2097
2114 register_hotcpu_notifier(&mca_cpu_notifier);
2115
2116 /* Setup the CMCI/P vector and handler */ 2098 /* Setup the CMCI/P vector and handler */
2117 setup_timer(&cmc_poll_timer, ia64_mca_cmc_poll, 0UL); 2099 setup_timer(&cmc_poll_timer, ia64_mca_cmc_poll, 0UL);
2118 2100
2119 /* Unmask/enable the vector */ 2101 /* Unmask/enable the vector */
2120 cmc_polling_enabled = 0; 2102 cmc_polling_enabled = 0;
2121 schedule_work(&cmc_enable_work); 2103 cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "ia64/mca:online",
2122 2104 ia64_mca_cpu_online, NULL);
2123 IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __func__); 2105 IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __func__);
2124 2106
2125#ifdef CONFIG_ACPI 2107#ifdef CONFIG_ACPI