public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.5] Remove BUG in cpu_up
@ 2002-11-13  3:42 Zwane Mwaikambo
  2002-11-13  9:33 ` Rusty Russell
  0 siblings, 1 reply; 7+ messages in thread
From: Zwane Mwaikambo @ 2002-11-13  3:42 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linux Kernel, Linus Torvalds

I think a BUG here is a bit on the extreme side, we already have a running 
processor (in boot i'd presume its the BSP) so we can afford to limp on. 
At runtime a stopped/dead processor which refuses to come back up 
shouldn't make the kernel oops.

	Zwane

Index: linux-2.5.47/kernel/cpu.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.47/kernel/cpu.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 cpu.c
--- linux-2.5.47/kernel/cpu.c	11 Nov 2002 03:59:33 -0000	1.1.1.1
+++ linux-2.5.47/kernel/cpu.c	13 Nov 2002 03:37:37 -0000
@@ -35,13 +35,11 @@
 		return ret;
 
 	if (cpu_online(cpu)) {
-		ret = -EINVAL;
+		ret = -EBUSY;
 		goto out;
 	}
 	ret = notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
 	if (ret == NOTIFY_BAD) {
-		printk("%s: attempt to bring up CPU %u failed\n",
-				__FUNCTION__, cpu);
 		ret = -EINVAL;
 		goto out_notify;
 	}
@@ -50,16 +48,22 @@
 	ret = __cpu_up(cpu);
 	if (ret != 0)
 		goto out_notify;
-	if (!cpu_online(cpu))
-		BUG();
+
+	if (!cpu_online(cpu)) {
+		ret = -EIO;
+		goto out_notify;
+	}
 
 	/* Now call notifier in preparation. */
-	printk("CPU %u IS NOW UP!\n", cpu);
+	printk(KERN_INFO "CPU %u IS NOW UP!\n", cpu);
 	notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
 
 out_notify:
-	if (ret != 0)
+	if (ret != 0) {
+		printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
+			__FUNCTION__, cpu);
 		notifier_call_chain(&cpu_chain, CPU_UP_CANCELED, hcpu);
+	}
 out:
 	up(&cpucontrol);
 	return ret;
-- 
function.linuxpower.ca


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

end of thread, other threads:[~2002-11-14 22:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-13  3:42 [PATCH][2.5] Remove BUG in cpu_up Zwane Mwaikambo
2002-11-13  9:33 ` Rusty Russell
2002-11-13 13:17   ` Zwane Mwaikambo
2002-11-14  1:56     ` Rusty Russell
2002-11-14  3:18       ` Zwane Mwaikambo
2002-11-14  5:08         ` Rusty Russell
2002-11-14 22:24           ` Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox