diff options
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 3d4206ada5c9..36e70845cfc3 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -254,6 +254,12 @@ int __cpuinit cpu_up(unsigned int cpu) | |||
254 | } | 254 | } |
255 | 255 | ||
256 | #ifdef CONFIG_SUSPEND_SMP | 256 | #ifdef CONFIG_SUSPEND_SMP |
257 | /* Needed to prevent the microcode driver from requesting firmware in its CPU | ||
258 | * hotplug notifier during the suspend/resume. | ||
259 | */ | ||
260 | int suspend_cpu_hotplug; | ||
261 | EXPORT_SYMBOL(suspend_cpu_hotplug); | ||
262 | |||
257 | static cpumask_t frozen_cpus; | 263 | static cpumask_t frozen_cpus; |
258 | 264 | ||
259 | int disable_nonboot_cpus(void) | 265 | int disable_nonboot_cpus(void) |
@@ -261,16 +267,8 @@ int disable_nonboot_cpus(void) | |||
261 | int cpu, first_cpu, error = 0; | 267 | int cpu, first_cpu, error = 0; |
262 | 268 | ||
263 | mutex_lock(&cpu_add_remove_lock); | 269 | mutex_lock(&cpu_add_remove_lock); |
264 | first_cpu = first_cpu(cpu_present_map); | 270 | suspend_cpu_hotplug = 1; |
265 | if (!cpu_online(first_cpu)) { | 271 | first_cpu = first_cpu(cpu_online_map); |
266 | error = _cpu_up(first_cpu); | ||
267 | if (error) { | ||
268 | printk(KERN_ERR "Could not bring CPU%d up.\n", | ||
269 | first_cpu); | ||
270 | goto out; | ||
271 | } | ||
272 | } | ||
273 | |||
274 | /* We take down all of the non-boot CPUs in one shot to avoid races | 272 | /* We take down all of the non-boot CPUs in one shot to avoid races |
275 | * with the userspace trying to use the CPU hotplug at the same time | 273 | * with the userspace trying to use the CPU hotplug at the same time |
276 | */ | 274 | */ |
@@ -296,7 +294,7 @@ int disable_nonboot_cpus(void) | |||
296 | } else { | 294 | } else { |
297 | printk(KERN_ERR "Non-boot CPUs are not disabled\n"); | 295 | printk(KERN_ERR "Non-boot CPUs are not disabled\n"); |
298 | } | 296 | } |
299 | out: | 297 | suspend_cpu_hotplug = 0; |
300 | mutex_unlock(&cpu_add_remove_lock); | 298 | mutex_unlock(&cpu_add_remove_lock); |
301 | return error; | 299 | return error; |
302 | } | 300 | } |
@@ -308,20 +306,22 @@ void enable_nonboot_cpus(void) | |||
308 | /* Allow everyone to use the CPU hotplug again */ | 306 | /* Allow everyone to use the CPU hotplug again */ |
309 | mutex_lock(&cpu_add_remove_lock); | 307 | mutex_lock(&cpu_add_remove_lock); |
310 | cpu_hotplug_disabled = 0; | 308 | cpu_hotplug_disabled = 0; |
311 | mutex_unlock(&cpu_add_remove_lock); | ||
312 | if (cpus_empty(frozen_cpus)) | 309 | if (cpus_empty(frozen_cpus)) |
313 | return; | 310 | goto out; |
314 | 311 | ||
312 | suspend_cpu_hotplug = 1; | ||
315 | printk("Enabling non-boot CPUs ...\n"); | 313 | printk("Enabling non-boot CPUs ...\n"); |
316 | for_each_cpu_mask(cpu, frozen_cpus) { | 314 | for_each_cpu_mask(cpu, frozen_cpus) { |
317 | error = cpu_up(cpu); | 315 | error = _cpu_up(cpu); |
318 | if (!error) { | 316 | if (!error) { |
319 | printk("CPU%d is up\n", cpu); | 317 | printk("CPU%d is up\n", cpu); |
320 | continue; | 318 | continue; |
321 | } | 319 | } |
322 | printk(KERN_WARNING "Error taking CPU%d up: %d\n", | 320 | printk(KERN_WARNING "Error taking CPU%d up: %d\n", cpu, error); |
323 | cpu, error); | ||
324 | } | 321 | } |
325 | cpus_clear(frozen_cpus); | 322 | cpus_clear(frozen_cpus); |
323 | suspend_cpu_hotplug = 0; | ||
324 | out: | ||
325 | mutex_unlock(&cpu_add_remove_lock); | ||
326 | } | 326 | } |
327 | #endif | 327 | #endif |