diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-12-23 10:55:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-23 16:59:33 -0500 |
commit | e1d9fd2e3d33b2fec3207171ec8ca6e71d5c81c7 (patch) | |
tree | 541652a20988e413edeba6bd00d150a07d65227f | |
parent | ffaa82008f1aad52a6d3979f49d2a76c2928b60f (diff) |
[PATCH] suspend: fix suspend on single-CPU systems
Clark Williams reported that suspend doesnt work on his laptop on
2.6.20-rc1-rt kernels. The bug was introduced by the following cleanup
commit:
commit 112cecb2cc0e7341db92281ba04b26c41bb8146d
Author: Siddha, Suresh B <suresh.b.siddha@intel.com>
Date: Wed Dec 6 20:34:31 2006 -0800
[PATCH] suspend: don't change cpus_allowed for task initiating the suspend
because with this change 'error' is not initialized to 0 anymore, if
there are no other online CPUs. (i.e. if the system is single-CPU).
the fix is the initialize it to 0. The really weird thing is that my
version of gcc does not warn about this non-initialized variable
situation ...
(also fix the kernel printk in the error branch, it was missing a
newline)
Reported-by: Clark Williams <williams@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 9124669f4586..241064a32241 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -258,7 +258,7 @@ static cpumask_t frozen_cpus; | |||
258 | 258 | ||
259 | int disable_nonboot_cpus(void) | 259 | int disable_nonboot_cpus(void) |
260 | { | 260 | { |
261 | int cpu, first_cpu, error; | 261 | int cpu, first_cpu, error = 0; |
262 | 262 | ||
263 | mutex_lock(&cpu_add_remove_lock); | 263 | mutex_lock(&cpu_add_remove_lock); |
264 | first_cpu = first_cpu(cpu_present_map); | 264 | first_cpu = first_cpu(cpu_present_map); |
@@ -294,7 +294,7 @@ int disable_nonboot_cpus(void) | |||
294 | /* Make sure the CPUs won't be enabled by someone else */ | 294 | /* Make sure the CPUs won't be enabled by someone else */ |
295 | cpu_hotplug_disabled = 1; | 295 | cpu_hotplug_disabled = 1; |
296 | } else { | 296 | } else { |
297 | printk(KERN_ERR "Non-boot CPUs are not disabled"); | 297 | printk(KERN_ERR "Non-boot CPUs are not disabled\n"); |
298 | } | 298 | } |
299 | out: | 299 | out: |
300 | mutex_unlock(&cpu_add_remove_lock); | 300 | mutex_unlock(&cpu_add_remove_lock); |