[PATCH] ppc64: Fix for missing start-cpu rtas token

Anton Blanchard anton at samba.org
Mon Sep 12 13:17:27 EST 2005


If the rtas start-cpu token doesnt exist then presume the cpu is already
spinning. If it isnt we will catch it later on when the cpu doesnt
respond.

Signed-off-by: Anton Blanchard <anton at samba.org>
---

Index: build/arch/ppc64/kernel/pSeries_smp.c
===================================================================
--- build.orig/arch/ppc64/kernel/pSeries_smp.c	2005-09-05 16:11:18.000000000 +1000
+++ build/arch/ppc64/kernel/pSeries_smp.c	2005-09-05 22:26:05.000000000 +1000
@@ -272,6 +272,7 @@
 	unsigned long start_here = __pa((u32)*((unsigned long *)
 					       pSeries_secondary_smp_init));
 	unsigned int pcpu;
+	int start_cpu;
 
 	if (cpu_isset(lcpu, of_spin_map))
 		/* Already started by OF and sitting in spin loop */
@@ -282,12 +283,20 @@
 	/* Fixup atomic count: it exited inside IRQ handler. */
 	paca[lcpu].__current->thread_info->preempt_count	= 0;
 
-	status = rtas_call(rtas_token("start-cpu"), 3, 1, NULL,
-			   pcpu, start_here, lcpu);
+	/* 
+	 * If the RTAS start-cpu token does not exist then presume the
+	 * cpu is already spinning.
+	 */
+	start_cpu = rtas_token("start-cpu");
+	if (start_cpu == RTAS_UNKNOWN_SERVICE)
+		return 1;
+
+	status = rtas_call(start_cpu, 3, 1, NULL, pcpu, start_here, lcpu);
 	if (status != 0) {
 		printk(KERN_ERR "start-cpu failed: %i\n", status);
 		return 0;
 	}
+
 	return 1;
 }
 



More information about the Linuxppc64-dev mailing list