svn commit: r277672 - projects/powernv/powerpc/powernv

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun Jan 25 02:48:27 UTC 2015


Author: nwhitehorn
Date: Sun Jan 25 02:48:26 2015
New Revision: 277672
URL: https://svnweb.freebsd.org/changeset/base/277672

Log:
  Correctly start secondary CPUs.

Modified:
  projects/powernv/powerpc/powernv/platform_powernv.c

Modified: projects/powernv/powerpc/powernv/platform_powernv.c
==============================================================================
--- projects/powernv/powerpc/powernv/platform_powernv.c	Sun Jan 25 02:47:35 2015	(r277671)
+++ projects/powernv/powerpc/powernv/platform_powernv.c	Sun Jan 25 02:48:26 2015	(r277672)
@@ -71,6 +71,7 @@ static int powernv_smp_start_cpu(platfor
 static struct cpu_group *powernv_smp_topo(platform_t plat);
 #endif
 static void powernv_reset(platform_t);
+static void powernv_cpu_idle(sbintime_t sbt);
 
 static platform_method_t powernv_methods[] = {
 	PLATFORMMETHOD(platform_probe, 		powernv_probe),
@@ -115,6 +116,8 @@ powernv_attach(platform_t plat)
 	/* Ping OPAL again just to make sure */
 	opal_check();
 
+	cpu_idle_hook = powernv_cpu_idle;
+
 	return (0);
 }
 
@@ -270,23 +273,19 @@ powernv_smp_get_bsp(platform_t plat, str
 static int
 powernv_smp_start_cpu(platform_t plat, struct pcpu *pc)
 {
-	int result, err, timeout;
+	int result;
 
 	ap_pcpu = pc;
 	powerpc_sync();
 
 	result = opal_call(OPAL_START_CPU, pc->pc_cpuid, EXC_RST);
-	if (result < 0 || err != 0) {
-		printf("OPAL error (%d/%d): unable to start AP %d\n",
-		    result, err, pc->pc_cpuid);
+	if (result != OPAL_SUCCESS) {
+		printf("OPAL error (%d): unable to start AP %d\n",
+		    result, pc->pc_cpuid);
 		return (ENXIO);
 	}
 
-	timeout = 10000;
-	while (!pc->pc_awake && timeout--)
-		DELAY(100);
-
-	return ((pc->pc_awake) ? 0 : EBUSY);
+	return (0);
 }
 
 static struct cpu_group *
@@ -333,3 +332,7 @@ powernv_smp_ap_init(platform_t platform)
 {
 }
 
+static void
+powernv_cpu_idle(sbintime_t sbt)
+{
+}


More information about the svn-src-projects mailing list