All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] suspend: fix suspend on single-CPU systems
@ 2006-12-23 15:55 Ingo Molnar
  2006-12-23 23:29 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2006-12-23 15:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Siddha, Suresh B, Clark Williams, Andrew Morton

Subject: [patch] suspend: fix suspend on single-CPU systems
From: Ingo Molnar <mingo@elte.hu>

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>
---
 kernel/cpu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux/kernel/cpu.c
===================================================================
--- linux.orig/kernel/cpu.c
+++ linux/kernel/cpu.c
@@ -258,7 +258,7 @@ static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
 {
-	int cpu, first_cpu, error;
+	int cpu, first_cpu, error = 0;
 
 	mutex_lock(&cpu_add_remove_lock);
 	first_cpu = first_cpu(cpu_present_map);
@@ -294,7 +294,7 @@ int disable_nonboot_cpus(void)
 		/* Make sure the CPUs won't be enabled by someone else */
 		cpu_hotplug_disabled = 1;
 	} else {
-		printk(KERN_ERR "Non-boot CPUs are not disabled");
+		printk(KERN_ERR "Non-boot CPUs are not disabled\n");
 	}
 out:
 	mutex_unlock(&cpu_add_remove_lock);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] suspend: fix suspend on single-CPU systems
  2006-12-23 15:55 [patch] suspend: fix suspend on single-CPU systems Ingo Molnar
@ 2006-12-23 23:29 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2006-12-23 23:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, linux-kernel, Siddha, Suresh B, Clark Williams,
	Andrew Morton

> Subject: [patch] suspend: fix suspend on single-CPU systems
> From: Ingo Molnar <mingo@elte.hu>
> 
> 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>

Looks okay to me.

-- 
Thanks, Sharp!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-23 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-23 15:55 [patch] suspend: fix suspend on single-CPU systems Ingo Molnar
2006-12-23 23:29 ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.