aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-25 17:05:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-25 17:05:56 -0500
commitb272f732f888d4cf43c943a40c9aaa836f9b7431 (patch)
treeda9cac6b9d12b83592c16d3503c0e3f2f00f146f /include/linux
parent10bbe7599e2755d3f3e100103967788b8b5a4bce (diff)
parent008b69e4d52f2cbee3ed0d0502edd78155000b1a (diff)
Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull SMP hotplug notifier removal from Thomas Gleixner: "This is the final cleanup of the hotplug notifier infrastructure. The series has been reintgrated in the last two days because there came a new driver using the old infrastructure via the SCSI tree. Summary: - convert the last leftover drivers utilizing notifiers - fixup for a completely broken hotplug user - prevent setup of already used states - removal of the notifiers - treewide cleanup of hotplug state names - consolidation of state space There is a sphinx based documentation pending, but that needs review from the documentation folks" * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/armada-xp: Consolidate hotplug state space irqchip/gic: Consolidate hotplug state space coresight/etm3/4x: Consolidate hotplug state space cpu/hotplug: Cleanup state names cpu/hotplug: Remove obsolete cpu hotplug register/unregister functions staging/lustre/libcfs: Convert to hotplug state machine scsi/bnx2i: Convert to hotplug state machine scsi/bnx2fc: Convert to hotplug state machine cpu/hotplug: Prevent overwriting of callbacks x86/msr: Remove bogus cleanup from the error path bus: arm-ccn: Prevent hotplug callback leak perf/x86/intel/cstate: Prevent hotplug callback leak ARM/imx/mmcd: Fix broken cpu hotplug handling scsi: qedi: Convert to hotplug state machine
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpu.h90
-rw-r--r--include/linux/cpuhotplug.h9
2 files changed, 3 insertions, 96 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 09807c2ce328..21f9c74496e7 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -57,9 +57,6 @@ struct notifier_block;
57 57
58#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ 58#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
59#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ 59#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
60#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
61#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
62#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
63#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 60#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
64#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 61#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
65 * lock is dropped */ 62 * lock is dropped */
@@ -80,80 +77,14 @@ struct notifier_block;
80 77
81#ifdef CONFIG_SMP 78#ifdef CONFIG_SMP
82extern bool cpuhp_tasks_frozen; 79extern bool cpuhp_tasks_frozen;
83/* Need to know about CPUs going up/down? */
84#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE)
85#define cpu_notifier(fn, pri) { \
86 static struct notifier_block fn##_nb = \
87 { .notifier_call = fn, .priority = pri }; \
88 register_cpu_notifier(&fn##_nb); \
89}
90
91#define __cpu_notifier(fn, pri) { \
92 static struct notifier_block fn##_nb = \
93 { .notifier_call = fn, .priority = pri }; \
94 __register_cpu_notifier(&fn##_nb); \
95}
96
97extern int register_cpu_notifier(struct notifier_block *nb);
98extern int __register_cpu_notifier(struct notifier_block *nb);
99extern void unregister_cpu_notifier(struct notifier_block *nb);
100extern void __unregister_cpu_notifier(struct notifier_block *nb);
101
102#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
103#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
104#define __cpu_notifier(fn, pri) do { (void)(fn); } while (0)
105
106static inline int register_cpu_notifier(struct notifier_block *nb)
107{
108 return 0;
109}
110
111static inline int __register_cpu_notifier(struct notifier_block *nb)
112{
113 return 0;
114}
115
116static inline void unregister_cpu_notifier(struct notifier_block *nb)
117{
118}
119
120static inline void __unregister_cpu_notifier(struct notifier_block *nb)
121{
122}
123#endif
124
125int cpu_up(unsigned int cpu); 80int cpu_up(unsigned int cpu);
126void notify_cpu_starting(unsigned int cpu); 81void notify_cpu_starting(unsigned int cpu);
127extern void cpu_maps_update_begin(void); 82extern void cpu_maps_update_begin(void);
128extern void cpu_maps_update_done(void); 83extern void cpu_maps_update_done(void);
129 84
130#define cpu_notifier_register_begin cpu_maps_update_begin
131#define cpu_notifier_register_done cpu_maps_update_done
132
133#else /* CONFIG_SMP */ 85#else /* CONFIG_SMP */
134#define cpuhp_tasks_frozen 0 86#define cpuhp_tasks_frozen 0
135 87
136#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
137#define __cpu_notifier(fn, pri) do { (void)(fn); } while (0)
138
139static inline int register_cpu_notifier(struct notifier_block *nb)
140{
141 return 0;
142}
143
144static inline int __register_cpu_notifier(struct notifier_block *nb)
145{
146 return 0;
147}
148
149static inline void unregister_cpu_notifier(struct notifier_block *nb)
150{
151}
152
153static inline void __unregister_cpu_notifier(struct notifier_block *nb)
154{
155}
156
157static inline void cpu_maps_update_begin(void) 88static inline void cpu_maps_update_begin(void)
158{ 89{
159} 90}
@@ -162,14 +93,6 @@ static inline void cpu_maps_update_done(void)
162{ 93{
163} 94}
164 95
165static inline void cpu_notifier_register_begin(void)
166{
167}
168
169static inline void cpu_notifier_register_done(void)
170{
171}
172
173#endif /* CONFIG_SMP */ 96#endif /* CONFIG_SMP */
174extern struct bus_type cpu_subsys; 97extern struct bus_type cpu_subsys;
175 98
@@ -182,12 +105,6 @@ extern void get_online_cpus(void);
182extern void put_online_cpus(void); 105extern void put_online_cpus(void);
183extern void cpu_hotplug_disable(void); 106extern void cpu_hotplug_disable(void);
184extern void cpu_hotplug_enable(void); 107extern void cpu_hotplug_enable(void);
185#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
186#define __hotcpu_notifier(fn, pri) __cpu_notifier(fn, pri)
187#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
188#define __register_hotcpu_notifier(nb) __register_cpu_notifier(nb)
189#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
190#define __unregister_hotcpu_notifier(nb) __unregister_cpu_notifier(nb)
191void clear_tasks_mm_cpumask(int cpu); 108void clear_tasks_mm_cpumask(int cpu);
192int cpu_down(unsigned int cpu); 109int cpu_down(unsigned int cpu);
193 110
@@ -199,13 +116,6 @@ static inline void cpu_hotplug_done(void) {}
199#define put_online_cpus() do { } while (0) 116#define put_online_cpus() do { } while (0)
200#define cpu_hotplug_disable() do { } while (0) 117#define cpu_hotplug_disable() do { } while (0)
201#define cpu_hotplug_enable() do { } while (0) 118#define cpu_hotplug_enable() do { } while (0)
202#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
203#define __hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
204/* These aren't inline functions due to a GCC bug. */
205#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
206#define __register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
207#define unregister_hotcpu_notifier(nb) ({ (void)(nb); })
208#define __unregister_hotcpu_notifier(nb) ({ (void)(nb); })
209#endif /* CONFIG_HOTPLUG_CPU */ 119#endif /* CONFIG_HOTPLUG_CPU */
210 120
211#ifdef CONFIG_PM_SLEEP_SMP 121#ifdef CONFIG_PM_SLEEP_SMP
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 2ab7bf53d529..20bfefbe7594 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -41,6 +41,9 @@ enum cpuhp_state {
41 CPUHP_NET_DEV_DEAD, 41 CPUHP_NET_DEV_DEAD,
42 CPUHP_PCI_XGENE_DEAD, 42 CPUHP_PCI_XGENE_DEAD,
43 CPUHP_IOMMU_INTEL_DEAD, 43 CPUHP_IOMMU_INTEL_DEAD,
44 CPUHP_LUSTRE_CFS_DEAD,
45 CPUHP_SCSI_BNX2FC_DEAD,
46 CPUHP_SCSI_BNX2I_DEAD,
44 CPUHP_WORKQUEUE_PREP, 47 CPUHP_WORKQUEUE_PREP,
45 CPUHP_POWER_NUMA_PREPARE, 48 CPUHP_POWER_NUMA_PREPARE,
46 CPUHP_HRTIMERS_PREPARE, 49 CPUHP_HRTIMERS_PREPARE,
@@ -56,7 +59,6 @@ enum cpuhp_state {
56 CPUHP_POWERPC_MMU_CTX_PREPARE, 59 CPUHP_POWERPC_MMU_CTX_PREPARE,
57 CPUHP_XEN_PREPARE, 60 CPUHP_XEN_PREPARE,
58 CPUHP_XEN_EVTCHN_PREPARE, 61 CPUHP_XEN_EVTCHN_PREPARE,
59 CPUHP_NOTIFY_PREPARE,
60 CPUHP_ARM_SHMOBILE_SCU_PREPARE, 62 CPUHP_ARM_SHMOBILE_SCU_PREPARE,
61 CPUHP_SH_SH3X_PREPARE, 63 CPUHP_SH_SH3X_PREPARE,
62 CPUHP_BLK_MQ_PREPARE, 64 CPUHP_BLK_MQ_PREPARE,
@@ -71,7 +73,6 @@ enum cpuhp_state {
71 CPUHP_KVM_PPC_BOOK3S_PREPARE, 73 CPUHP_KVM_PPC_BOOK3S_PREPARE,
72 CPUHP_ZCOMP_PREPARE, 74 CPUHP_ZCOMP_PREPARE,
73 CPUHP_TIMERS_DEAD, 75 CPUHP_TIMERS_DEAD,
74 CPUHP_NOTF_ERR_INJ_PREPARE,
75 CPUHP_MIPS_SOC_PREPARE, 76 CPUHP_MIPS_SOC_PREPARE,
76 CPUHP_BRINGUP_CPU, 77 CPUHP_BRINGUP_CPU,
77 CPUHP_AP_IDLE_DEAD, 78 CPUHP_AP_IDLE_DEAD,
@@ -79,10 +80,8 @@ enum cpuhp_state {
79 CPUHP_AP_SCHED_STARTING, 80 CPUHP_AP_SCHED_STARTING,
80 CPUHP_AP_RCUTREE_DYING, 81 CPUHP_AP_RCUTREE_DYING,
81 CPUHP_AP_IRQ_GIC_STARTING, 82 CPUHP_AP_IRQ_GIC_STARTING,
82 CPUHP_AP_IRQ_GICV3_STARTING,
83 CPUHP_AP_IRQ_HIP04_STARTING, 83 CPUHP_AP_IRQ_HIP04_STARTING,
84 CPUHP_AP_IRQ_ARMADA_XP_STARTING, 84 CPUHP_AP_IRQ_ARMADA_XP_STARTING,
85 CPUHP_AP_IRQ_ARMADA_CASC_STARTING,
86 CPUHP_AP_IRQ_BCM2836_STARTING, 85 CPUHP_AP_IRQ_BCM2836_STARTING,
87 CPUHP_AP_ARM_MVEBU_COHERENCY, 86 CPUHP_AP_ARM_MVEBU_COHERENCY,
88 CPUHP_AP_PERF_X86_UNCORE_STARTING, 87 CPUHP_AP_PERF_X86_UNCORE_STARTING,
@@ -118,7 +117,6 @@ enum cpuhp_state {
118 CPUHP_AP_DUMMY_TIMER_STARTING, 117 CPUHP_AP_DUMMY_TIMER_STARTING,
119 CPUHP_AP_ARM_XEN_STARTING, 118 CPUHP_AP_ARM_XEN_STARTING,
120 CPUHP_AP_ARM_CORESIGHT_STARTING, 119 CPUHP_AP_ARM_CORESIGHT_STARTING,
121 CPUHP_AP_ARM_CORESIGHT4_STARTING,
122 CPUHP_AP_ARM64_ISNDEP_STARTING, 120 CPUHP_AP_ARM64_ISNDEP_STARTING,
123 CPUHP_AP_SMPCFD_DYING, 121 CPUHP_AP_SMPCFD_DYING,
124 CPUHP_AP_X86_TBOOT_DYING, 122 CPUHP_AP_X86_TBOOT_DYING,
@@ -142,7 +140,6 @@ enum cpuhp_state {
142 CPUHP_AP_PERF_ARM_L2X0_ONLINE, 140 CPUHP_AP_PERF_ARM_L2X0_ONLINE,
143 CPUHP_AP_WORKQUEUE_ONLINE, 141 CPUHP_AP_WORKQUEUE_ONLINE,
144 CPUHP_AP_RCUTREE_ONLINE, 142 CPUHP_AP_RCUTREE_ONLINE,
145 CPUHP_AP_NOTIFY_ONLINE,
146 CPUHP_AP_ONLINE_DYN, 143 CPUHP_AP_ONLINE_DYN,
147 CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30, 144 CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
148 CPUHP_AP_X86_HPET_ONLINE, 145 CPUHP_AP_X86_HPET_ONLINE,