aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 341bf80f80bd..92c2451db415 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -889,6 +889,7 @@ void notify_cpu_starting(unsigned int cpu)
889 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); 889 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
890 enum cpuhp_state target = min((int)st->target, CPUHP_AP_ONLINE); 890 enum cpuhp_state target = min((int)st->target, CPUHP_AP_ONLINE);
891 891
892 rcu_cpu_starting(cpu); /* Enables RCU usage on this CPU. */
892 while (st->state < target) { 893 while (st->state < target) {
893 struct cpuhp_step *step; 894 struct cpuhp_step *step;
894 895
@@ -1024,12 +1025,13 @@ EXPORT_SYMBOL_GPL(cpu_up);
1024#ifdef CONFIG_PM_SLEEP_SMP 1025#ifdef CONFIG_PM_SLEEP_SMP
1025static cpumask_var_t frozen_cpus; 1026static cpumask_var_t frozen_cpus;
1026 1027
1027int disable_nonboot_cpus(void) 1028int freeze_secondary_cpus(int primary)
1028{ 1029{
1029 int cpu, first_cpu, error = 0; 1030 int cpu, error = 0;
1030 1031
1031 cpu_maps_update_begin(); 1032 cpu_maps_update_begin();
1032 first_cpu = cpumask_first(cpu_online_mask); 1033 if (!cpu_online(primary))
1034 primary = cpumask_first(cpu_online_mask);
1033 /* 1035 /*
1034 * We take down all of the non-boot CPUs in one shot to avoid races 1036 * We take down all of the non-boot CPUs in one shot to avoid races
1035 * with the userspace trying to use the CPU hotplug at the same time 1037 * with the userspace trying to use the CPU hotplug at the same time
@@ -1038,7 +1040,7 @@ int disable_nonboot_cpus(void)
1038 1040
1039 pr_info("Disabling non-boot CPUs ...\n"); 1041 pr_info("Disabling non-boot CPUs ...\n");
1040 for_each_online_cpu(cpu) { 1042 for_each_online_cpu(cpu) {
1041 if (cpu == first_cpu) 1043 if (cpu == primary)
1042 continue; 1044 continue;
1043 trace_suspend_resume(TPS("CPU_OFF"), cpu, true); 1045 trace_suspend_resume(TPS("CPU_OFF"), cpu, true);
1044 error = _cpu_down(cpu, 1, CPUHP_OFFLINE); 1046 error = _cpu_down(cpu, 1, CPUHP_OFFLINE);