Lines 1016-1021
EXPORT_SYMBOL_GPL(cpu_up);
Link Here
|
1016 |
|
1016 |
|
1017 |
#ifdef CONFIG_PM_SLEEP_SMP |
1017 |
#ifdef CONFIG_PM_SLEEP_SMP |
1018 |
static cpumask_var_t frozen_cpus; |
1018 |
static cpumask_var_t frozen_cpus; |
|
|
1019 |
static cpumask_var_t offline_cpus; |
1020 |
|
1021 |
int kick_offline_cpus(int first) |
1022 |
{ |
1023 |
int cpu; |
1024 |
|
1025 |
if (offline_cpus == NULL) |
1026 |
return -ENOMEM; |
1027 |
|
1028 |
if (first) |
1029 |
cpumask_andnot(offline_cpus, cpu_possible_mask, cpu_online_mask); |
1030 |
|
1031 |
for_each_cpu(cpu, offline_cpus) { |
1032 |
_cpu_up(cpu, 1, CPUHP_ONLINE); |
1033 |
_cpu_down(cpu, 1, CPUHP_OFFLINE); |
1034 |
} |
1035 |
|
1036 |
return 0; |
1037 |
} |
1019 |
|
1038 |
|
1020 |
void __weak arch_disable_nonboot_cpus_pre(void) |
1039 |
void __weak arch_disable_nonboot_cpus_pre(void) |
1021 |
{ |
1040 |
{ |
Lines 1120-1125
static int __init alloc_frozen_cpus(void
Link Here
|
1120 |
{ |
1139 |
{ |
1121 |
if (!alloc_cpumask_var(&frozen_cpus, GFP_KERNEL|__GFP_ZERO)) |
1140 |
if (!alloc_cpumask_var(&frozen_cpus, GFP_KERNEL|__GFP_ZERO)) |
1122 |
return -ENOMEM; |
1141 |
return -ENOMEM; |
|
|
1142 |
/* No need to free frozen_cpus if failed. */ |
1143 |
if (!alloc_cpumask_var(&offline_cpus, GFP_KERNEL|__GFP_ZERO)) |
1144 |
return -ENOMEM; |
1123 |
return 0; |
1145 |
return 0; |
1124 |
} |
1146 |
} |
1125 |
core_initcall(alloc_frozen_cpus); |
1147 |
core_initcall(alloc_frozen_cpus); |