patch-2.1.129 linux/arch/sparc/kernel/sun4d_smp.c

Next file: linux/arch/sparc/kernel/sun4m_smp.c
Previous file: linux/arch/sparc/kernel/sparc_ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.128/linux/arch/sparc/kernel/sun4d_smp.c linux/arch/sparc/kernel/sun4d_smp.c
@@ -168,10 +168,6 @@
 
 	printk("Entering SMP Mode...\n");
 	
-	smp_penguin_ctable.which_io = 0;
-	smp_penguin_ctable.phys_addr = (unsigned int) srmmu_ctx_table_phys;
-	smp_penguin_ctable.reg_size = 0;
-
 	for (i = 0; i < NR_CPUS; i++)
 		cpu_offset[i] = (char *)&cpu_data[i] - (char *)&cpu_data;
 		
@@ -220,7 +216,16 @@
 			for (no = 0; no < linux_num_cpus; no++)
 				if (linux_cpus[no].mid == i)
 					break;
-			
+
+			/*
+			 * Initialize the contexts table
+			 * Since the call to prom_startcpu() trashes the structure,
+			 * we need to re-initialize it for each cpu
+			 */
+			smp_penguin_ctable.which_io = 0;
+			smp_penguin_ctable.phys_addr = (unsigned int) srmmu_ctx_table_phys;
+			smp_penguin_ctable.reg_size = 0;
+
 			/* whirrr, whirrr, whirrrrrrrrr... */
 			SMP_PRINTK(("Starting CPU %d at %p task %d node %08x\n", i, entry, cpucount, linux_cpus[no].prom_node));
 			local_flush_cache_all();
@@ -230,10 +235,10 @@
 			SMP_PRINTK(("prom_startcpu returned :)\n"));
 
 			/* wheee... it's going... */
-			for(timeout = 0; timeout < 5000000; timeout++) {
+			for(timeout = 0; timeout < 10000; timeout++) {
 				if(cpu_callin_map[i])
 					break;
-				udelay(100);
+				udelay(200);
 			}
 			
 			if(cpu_callin_map[i]) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov