Title: [7905] trunk/arch/blackfin: fix bug [#5735] - Release the boot_lock (and let core B run), only after the bit the bit Core B is set in cpu_online_mask.
Revision
7905
Author
adamliyi
Date
2009-12-02 02:58:12 -0500 (Wed, 02 Dec 2009)

Log Message

fix bug [#5735] - Release the boot_lock (and let core B run), only after the bit the bit Core B is set in cpu_online_mask.

Modified Paths

Diff

Modified: trunk/arch/blackfin/mach-bf561/smp.c (7904 => 7905)


--- trunk/arch/blackfin/mach-bf561/smp.c	2009-12-02 02:50:43 UTC (rev 7904)
+++ trunk/arch/blackfin/mach-bf561/smp.c	2009-12-02 07:58:12 UTC (rev 7905)
@@ -87,6 +87,7 @@
 int __cpuinit platform_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
+	int ret;
 
 	/* CoreB already running?! */
 	BUG_ON((bfin_read_SICA_SYSCR() & COREB_SRAM_INIT) == 0);
@@ -108,9 +109,17 @@
 		barrier();
 	}
 
+	ret = cpu_isset(cpu, cpu_callin_map) ? 0 : -ENOSYS;
+	if (ret) {
+		cpu_clear(cpu, cpu_present_map);
+		printk(KERN_CRIT "CPU%u: processor failed to boot (%d)\n", cpu, ret);
+		free_task(idle);
+	} else
+		cpu_set(cpu, cpu_online_map);
+
+	/* release the lock and let coreb run */
 	spin_unlock(&boot_lock);
-
-	return cpu_isset(cpu, cpu_callin_map) ? 0 : -ENOSYS;
+	return ret;
 }
 
 void __init platform_request_ipi(irq_handler_t handler)

Modified: trunk/arch/blackfin/mach-common/smp.c (7904 => 7905)


--- trunk/arch/blackfin/mach-common/smp.c	2009-12-02 02:50:43 UTC (rev 7904)
+++ trunk/arch/blackfin/mach-common/smp.c	2009-12-02 07:58:12 UTC (rev 7905)
@@ -333,13 +333,6 @@
 
 	ret = platform_boot_secondary(cpu, idle);
 
-	if (ret) {
-		cpu_clear(cpu, cpu_present_map);
-		printk(KERN_CRIT "CPU%u: processor failed to boot (%d)\n", cpu, ret);
-		free_task(idle);
-	} else
-		cpu_set(cpu, cpu_online_map);
-
 	secondary_stack = NULL;
 
 	return ret;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to