aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/stop_machine.h6
-rw-r--r--init/Kconfig7
-rw-r--r--kernel/stop_machine.c4
3 files changed, 5 insertions, 12 deletions
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 0adedca24c5b..0e1b1540597a 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -99,7 +99,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask,
99 * grabbing every spinlock (and more). So the "read" side to such a 99 * grabbing every spinlock (and more). So the "read" side to such a
100 * lock is anything which disables preemption. 100 * lock is anything which disables preemption.
101 */ 101 */
102#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 102#if defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU)
103 103
104/** 104/**
105 * stop_machine: freeze the machine on all CPUs and run this function 105 * stop_machine: freeze the machine on all CPUs and run this function
@@ -118,7 +118,7 @@ int stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus);
118 118
119int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, 119int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
120 const struct cpumask *cpus); 120 const struct cpumask *cpus);
121#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 121#else /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */
122 122
123static inline int stop_machine(cpu_stop_fn_t fn, void *data, 123static inline int stop_machine(cpu_stop_fn_t fn, void *data,
124 const struct cpumask *cpus) 124 const struct cpumask *cpus)
@@ -137,5 +137,5 @@ static inline int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
137 return stop_machine(fn, data, cpus); 137 return stop_machine(fn, data, cpus);
138} 138}
139 139
140#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 140#endif /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */
141#endif /* _LINUX_STOP_MACHINE */ 141#endif /* _LINUX_STOP_MACHINE */
diff --git a/init/Kconfig b/init/Kconfig
index c24b6f767bf0..235c7a2c0d20 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2030,13 +2030,6 @@ config INIT_ALL_POSSIBLE
2030 it was better to provide this option than to break all the archs 2030 it was better to provide this option than to break all the archs
2031 and have several arch maintainers pursuing me down dark alleys. 2031 and have several arch maintainers pursuing me down dark alleys.
2032 2032
2033config STOP_MACHINE
2034 bool
2035 default y
2036 depends on (SMP && MODULE_UNLOAD) || HOTPLUG_CPU
2037 help
2038 Need stop_machine() primitive.
2039
2040source "block/Kconfig" 2033source "block/Kconfig"
2041 2034
2042config PREEMPT_NOTIFIERS 2035config PREEMPT_NOTIFIERS
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 867bc20e1ef1..a3bbaee77c58 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -531,7 +531,7 @@ static int __init cpu_stop_init(void)
531} 531}
532early_initcall(cpu_stop_init); 532early_initcall(cpu_stop_init);
533 533
534#ifdef CONFIG_STOP_MACHINE 534#if defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU)
535 535
536static int __stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus) 536static int __stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)
537{ 537{
@@ -631,4 +631,4 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
631 return ret ?: done.ret; 631 return ret ?: done.ret;
632} 632}
633 633
634#endif /* CONFIG_STOP_MACHINE */ 634#endif /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */